Java LongBuffer convert to long array
import java.nio.LongBuffer; import java.util.Arrays; public class Main { public static void main(String[] argv) throws Exception { long[] longArray = new long[] { 3, 5, 6, 7, 8, 4 }; LongBuffer bb = LongBuffer.wrap(longArray); longArray = toArray(bb);/* w w w . j a va2s .c o m*/ System.out.println(Arrays.toString(longArray)); } public static long[] toArray(final LongBuffer buffer) { long[] array = new long[buffer.limit()]; buffer.get(array); return array; } }