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(100L); bb.rewind(); LongBuffer longBuffer2 = LongBuffer.allocate(10); longBuffer2.put(bb); System.out.println(Arrays.toString(longBuffer2.array())); } }