/** * Same function as in GLApp.java. Allocates a ByteBuffer to hold the given array of bytes. * * @param bytearray * @return ByteBuffer containing the contents of the byte array */ public static ByteBuffer allocBytes(byte[] bytearray) { ByteBuffer bb = ByteBuffer.allocateDirect(bytearray.length).order(ByteOrder.nativeOrder()); bb.put(bytearray).flip(); return bb; }