List of utility methods to do ByteBuffer Create
ByteBuffer | makeByteBuffer(byte[] arr) Make a direct NIO ByteBuffer from an array of floats ByteBuffer bb = ByteBuffer.allocateDirect(arr.length);
bb.order(ByteOrder.nativeOrder());
bb.put(arr);
bb.position(0);
return bb;
|
ByteBuffer | makeByteBuffer(byte[] arr, int length) make Byte Buffer ByteBuffer bb = ByteBuffer.allocateDirect(length);
bb.order(ByteOrder.nativeOrder());
bb.put(arr, 0, length);
bb.position(0);
return bb;
|
ByteBuffer | makeByteBuffer(byte[] i_arr) make Byte Buffer ByteBuffer bb = ByteBuffer.allocateDirect(i_arr.length);
bb.put(i_arr);
bb.position(0);
return bb;
|
ByteBuffer | makeByteBuffer(int size) make Byte Buffer ByteBuffer bb = ByteBuffer.allocateDirect(size);
bb.position(0);
return bb;
|
ByteBuffer | makeByteBuffer(int size) make Byte Buffer ByteBuffer bb = ByteBuffer.allocateDirect(size);
bb.position(0);
return bb;
|
ByteBuffer | makeByteBuffer(int size) make Byte Buffer ByteBuffer bb = ByteBuffer.allocateDirect(size);
bb.position(0);
return bb;
|
void | copyFromStreamToBuffer(ByteBuffer out, DataInputStream in, int length) Copy the given number of bytes from the given stream and put it at the current position of the given buffer, updating the position in the buffer. if (out.hasArray()) { in.readFully(out.array(), out.position() + out.arrayOffset(), length); skip(out, length); } else { for (int i = 0; i < length; ++i) { out.put(in.readByte()); |
void | appendSurrogate(ByteBuffer bb, char c) Append %Uxxxx to the given byte buffer.
bb.put((byte) '%'); bb.put((byte) 'U'); bb.put(HEX_DIGITS[(c >> 12) & 0x0f]); bb.put(HEX_DIGITS[(c >> 8) & 0x0f]); bb.put(HEX_DIGITS[(c >> 4) & 0x0f]); bb.put(HEX_DIGITS[c & 0x0f]); |