December 2015
Intermediate to advanced
292 pages
6h 16m
English
Buffers hold data temporarily because it is being moved to and from channels. When a buffer is created, it is created with a fixed size or capacity. Part or all of a buffer's memory can be used with several Buffer class fields available to manage the data in a buffer.
The Buffer class is abstract. However, it possesses the basic methods used to manipulate a buffer, including:
capacity: This returns the number of elements in the bufferlimit: This returns the first index of the buffer that should not be accessedposition: This returns the index of the next element to be read or writtenThe element depends on the buffer type.
The mark and reset methods also control the position within a buffer. The mark method will set the buffer's ...
Read now
Unlock full access