Java tutorial
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, 0, 2); System.out.println(Arrays.toString(longArray)); } }