Java tutorial
//package com.java2s; import java.nio.ByteBuffer; public class Main { public static ByteBuffer makeByteBuffer(byte[] i_arr) { ByteBuffer bb = ByteBuffer.allocateDirect(i_arr.length); bb.put(i_arr); bb.position(0); return bb; } }