Java IO Tutorial - Java LongBuffer.get(long[] dst, int offset, int length)








Syntax

LongBuffer.get(long[] dst, int offset, int length) has the following syntax.

public LongBuffer get(long[] dst,  int offset,  int length)

Example

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

import java.nio.LongBuffer;
import java.util.Arrays;
//from  w w w .jav  a  2 s  . c  o  m
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,0,2);
    
    System.out.println(Arrays.toString(longArray));

  }
}

The code above generates the following result.