List of utility methods to do ByteBuffer Create
ByteBuffer | allocaleByteBuffer(int capacity, boolean direct) allocale Byte Buffer return direct ? ByteBuffer.allocateDirect(capacity) : ByteBuffer.allocate(capacity);
|
ByteBuffer | allocateByteBuffer(boolean useDirectBuffer, int bufSize) allocate Byte Buffer if (useDirectBuffer) { return ByteBuffer.allocateDirect(bufSize); } else { return ByteBuffer.allocate(bufSize); |
ByteBuffer | allocateByteBuffer(final int bytes) Allocates a new direct ByteBuffer with the specified size and returns it. return ByteBuffer.allocateDirect(bytes);
|
ByteBuffer | allocateByteBuffer(int capacity) Allocate a ByteBuffer . return capacity >= MIN_DIRECT_BUFFER_SIZE ? ByteBuffer.allocateDirect(capacity)
: ByteBuffer.allocate(capacity);
|
ByteBuffer | createByteBuffer(byte... data) create Byte Buffer ByteBuffer bb = createByteBuffer(data.length);
bb.put(data);
bb.flip();
return bb;
|
ByteBuffer | createByteBuffer(byte... values) Constructs a direct native-ordered bytebuffer with the specified size. ByteBuffer buff = createByteBuffer(values.length);
buff.flip();
return (buff);
|
ByteBuffer | createByteBuffer(byte[] data) Create a ByteBuffer for the provided data using the default byte order ( DataTypeTestUtil#DEFAULT_BYTE_ORDER ). return createByteBuffer(data, DEFAULT_BYTE_ORDER);
|
ByteBuffer | createByteBuffer(int byteCount) create Byte Buffer return ByteBuffer.allocate(byteCount).order(NATIVE_BYTE_ORDER);
|
ByteBuffer | createByteBuffer(int capacity) create Byte Buffer return ByteBuffer.allocate(capacity);
|
ByteBuffer | createByteBuffer(int capacity) Allocates a direct native-ordered bytebuffer with the specified capacity. return ByteBuffer.allocateDirect(capacity).order(ByteOrder.nativeOrder());
|