Tag Archives: Java-Buffer

The rewind() method of java.nio.ByteBuffer Class is used to rewind this buffer. The position is set to zero and the mark is discarded. Invoke this… Read More
The duplicate() method of java.nio.Buffer class is used to create a new buffer that shares this buffer’s content. The content of the new buffer will… Read More
The hasArray() method of java.nio.Buffer class is used to tell whether or not this buffer is backed by an accessible array. If this method returns… Read More
The flip() method of java.nio.ByteBuffer Class is used to flip this buffer. The limit is set to the current position and then the position is… Read More
The mark() method of java.nio.Buffer Class is used to set this buffer’s mark at its position. Syntax: public Buffer mark() Return Value: This method returns… Read More
The capacity() method of java.nio.Buffer Class is used to return this buffer’s capacity. Syntax: public final int capacity() Return Value: The capacity of this buffer… Read More
The position(int newPosition) method of java.nio.Buffer Class is used to set this buffer’s position. If the mark is defined and larger than the new position… Read More
The clear() method of java.nio.ByteBuffer Class is used to clear this buffer. The position is set to zero, the limit is set to the capacity,… Read More
The isReadOnly() method of java.nio.Buffer class is used to tell whether or not this buffer is read-only. Syntax: public abstract boolean isReadOnly() Returns: This method… Read More
The reset() method of java.nio.Buffer Class is used to reset this buffer’s position to the previously-marked position. Invoking this method neither changes nor discards the… Read More
The hasRemaining() method of java.nio.Buffer class is used to tell whether there are any elements between the current position and the limit. Syntax: public final… Read More
The limit() method of java.nio.Buffer Class is used to set this buffer’s limit. If the position is larger than the new limit then it is… Read More
The remaining() method of java.nio.Buffer Class is used to return the number of elements between the current position and the limit. Syntax: public final int… Read More
The isDirect() method of java.nio.Buffer Class is used to tell whether or not this buffer is direct. Syntax: public abstract boolean isDirect() Return Value: This… Read More
The arrayOffset() method of java.nio.Buffer class is used to return the offset within the given buffer’s backing array of the first element of the buffer.… Read More