0

The part of NIO Buffer source code is as follows:

public abstract class Buffer {
   private int mark = -1;
   private int position = 0;
   private int limit;
   private int capacity;

   ...
}

I want to know what is the mark exactly used for. There is no comment related to that in the JDK source code.

Tunaki
  • 132,869
  • 46
  • 340
  • 423
solomons
  • 39
  • 3
  • Also related http://stackoverflow.com/q/5421653/1743880 – Tunaki Apr 19 '16 at 13:47
  • Probably it's used for [`mark()`](https://docs.oracle.com/javase/8/docs/api/java/nio/Buffer.html#mark--) / `reset()` – fabian Apr 19 '16 at 13:49
  • 1
    Side note: why didn't you study the source code then? You know, the variable is private, so it can only be used in that very class; so in order to understand what the variable is used for ... you could just have searched for its usage in that class ... – GhostCat Apr 19 '16 at 13:50

0 Answers0