IntBuffer class Methods in Java Part -I

java.nio.IntBuffer

An int buffer.

1. Absolute and relative get and put methods that read and write single ints.

2. Absolute and relative bulk get methods that transfer contiguous sequences of ints from this buffer into an array.

3. Absolute and Relative bulk put methods that transfer contiguous sequences of ints from an int array or some other int buffer into this buffer.

4.  A method for compacting an int buffer.


Some of the Methods of  IntBuffer class.


IntBuffer.allocate(int)This method allocates a new int buffer.


array()This method returns the int 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 int buffer that shares this buffer content.


capacity()This method returns this buffer's capacity.


clear()This method clears this buffer.


compact()This method compacts this buffer.


compareTo(IntBuffer) This method compares this buffer to another.


duplicate()This method creates a new int buffer that shares this buffer's content.


equals(Object)This method tells whether or not this buffer is equal to another object.


flip()This method flips this buffer.


get()This method reads the int at this buffer'scurrent position and then increments the position.


get(int)This method reads the int at the given index.


get(int[])This method transfers ints from this buffer into the given destination array.


get(int, int[])This method transfers ints from this buffer into the given destination array.


get(int[], int, int)This method transfers ints from this buffer into the given destination array.


get(int, int[], int, int)This method transfers length ints 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 int 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 int buffer is direct.


Some more Methods of IntBuffer


No comments:

Post a Comment