Java LongBuffer.get(long[] dst)

Syntax

LongBuffer.get(long[] dst) has the following syntax.

public LongBuffer get(long[] dst)

Example

In the following code shows how to use LongBuffer.get(long[] dst) method.


//from ww w  . j a v a 2s . com
import java.nio.LongBuffer;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    LongBuffer bb = LongBuffer.allocate(10);
    bb.put(100);
    
    bb.rewind();
    
    long[] longArray = new long[10];
    bb.get(longArray);
    
    System.out.println(Arrays.toString(longArray));

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.nio »




Buffer
ByteBuffer
ByteOrder
CharBuffer
DoubleBuffer
FloatBuffer
IntBuffer
LongBuffer
MappedByteBuffer
ShortBuffer