java.nio.LongBuffer
A long buffer.
1. Absolute and relative get and put methods that read and write single longs.
2. Absolute and relative bulk get methods that transfer contiguous sequences of longs from this buffer into an array.
3. Absolute and Relative bulk put methods that transfer contiguous sequences of longs from along array or some other long buffer into this buffer.
4. A method for compacting a long buffer.
Some of the Methods of LongBuffer class.
LongBuffer.allocate(int): This method allocates a new long buffer.
array(): This method returns the long array that backs this buffer.
arrayOffset(): This method returns the offset within this buffer's backing array of the first element of the buffer.
asReadOnlyBuffer(): This method creates a new, read-only long buffer that shares this buffer content.
capacity(): This method returns this buffer's capacity.
clear(): This method clears this buffer.
compact(): Compacts this buffer.
compareTo(LongBuffer): This method compares this buffer to another.
duplicate(): This method creates a new long buffer that shares this buffer's content.
equals(): This method tells whether or not this buffer is equal to another object.
flip(): This method flips this buffer. The limit is set to the current position and then the position is set to zero. If the mark is defined then it is discarded.
get(): This method reads the long at this buffer's current position and then increments the position.
get(int): This method reads the long at the given index.
get(long[]): This method transfers longs from this buffer into the given destination array.
get(int, long[]): This method transfers longs from this buffer into the given destination array.
get(long[], int, int): This method transfers longs from this buffer into the given destination array.
get(int, long[], int, int): This method transfers length longs from this buffer into the given array, starting at the given index in this buffer and at the given offset in the array.
getClass(): This method returns the runtime class of this Object.
hasArray(): This method tells whether or not this buffer is backed by an accessible long array.
hashCode(): This method returns the current hash code of this buffer.
hasRemaining(): This method tells whether there are any elements between the current position and the limit.
isDirect(): This method tells whether or not this long buffer is direct.
Some more Methods of LongBuffer Part -II
No comments:
Post a Comment