Name

LongBuffer

Synopsis

LongBuffer holds a sequence of long 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 long and long[ ] argument and return values instead of byte and byte[ ] values. See ByteBuffer for details.

LongBuffer 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” LongBuffer by calling the asLongBuffer( ) method of an underlying ByteBuffer.

java.nio.LongBuffer

Figure 13-9. java.nio.LongBuffer

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

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.