Name

IntBuffer

Synopsis

IntBuffer holds a sequence of int values for use in an I/O operation. Most of the methods of this class are directly analogous to methods defined by ByteBuffer except that they use int and int[ ] argument and return values instead of byte and byte[ ] values. See ByteBuffer for details.

IntBuffer is abstract and has no constructor. Create one by calling the static allocate( ) or wrap( ) methods, which are also analogs of ByteBuffer methods. Or, create a “view” IntBuffer by calling the asIntBuffer( ) method of an underlying ByteBuffer.

java.nio.IntBuffer

Figure 13-7. java.nio.IntBuffer

public abstract class IntBuffer extends Buffer implements Comparable<IntBuffer> {
// No Constructor
                  // Public Class Methods
     public static IntBuffer allocate(int capacity);  
     public static IntBuffer wrap(int[ ] array);  
     public static IntBuffer wrap(int[ ] array, int offset, int length);  
// Public Instance Methods
     public final int[ ] array( );  
     public final int arrayOffset( );  
     public abstract IntBuffer asReadOnlyBuffer( );  
     public abstract IntBuffer compact( );  
     public abstract IntBuffer duplicate( );  
     public abstract int get( );  
     public abstract int get(int index);  
     public IntBuffer get(int[ ] dst);  
     public IntBuffer get(int[ ] dst, int offset, int length);  
     public final boolean hasArray( );  
     public abstract boolean isDirect( );  
     public abstract ByteOrder order( );  
     public IntBuffer put(IntBuffer src); public ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.