Tag Archives: Java-ByteBuffer

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 reset() method of java.nio.ByteBuffer 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 mark() method of java.nio.ByteBuffer Class is used to set this buffer’s mark at its position. Syntax: public ByteBuffer mark() Return Value: 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 isDirect() method of java.nio.ByteBuffer Class is used to tell whether or not this byte buffer is direct. Syntax: public abstract boolean isDirect() Return Value:… 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 position(int newPosition) method of java.nio.ByteBuffer Class is used to Sets this buffer’s position. If the mark is defined and larger than the new position… Read More
The limit() method of java.nio.ByteBuffer Class is used to set this buffer’s limit. If the position is larger than the new limit then it is… Read More
wrap(byte[] array) The wrap() method of java.nio.ByteBuffer Class is used to wraps a byte array into a buffer. The new buffer will be backed by… Read More
putFloat(float value) The putFloat(float value) method of java.nio.ByteBuffer Class is used to write four bytes containing the given float value, in the current byte order,… Read More
putChar(char value) The putChar(char value) method of java.nio.ByteBuffer Class is used to write two bytes containing the given char value, in the current byte order,… Read More
put(byte b) The put(byte b) method of java.nio.ByteBuffer Class is used to write the given byte into the newly created byte buffer at the current… Read More
The slice() method of java.nio.ByteBuffer Class is used to creates a new byte buffer whose content is a shared subsequence of the given buffer’s content.… Read More
putDouble(double value) The putDouble(double value) method of java.nio.ByteBuffer Class is used to write eight bytes containing the given double value, in the current byte order,… Read More
putLong(int value) The putLong(int value) method of java.nio.ByteBuffer Class is used to write eight bytes containing the given long value, in the current byte order,… Read More