Java tutorial
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { public static ByteBuffer makeByteBuffer(byte[] array) /* */ { /* 63 */int SIZE = 1; /* 64 */ByteBuffer byteBuffer = ByteBuffer.allocateDirect(array.length * 1); /* 65 */byteBuffer.order(ByteOrder.nativeOrder()); /* 66 */byteBuffer.put(array); /* 67 */byteBuffer.position(0); /* 68 */return byteBuffer; /* */} }