Object
ByteBufferUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
asBytes
(ByteBuffer data) If inputByteBuffer
is direct (keeps data in native memory) it will copy all data to byte array (inside Java Heap) and return it.asString
(ByteBuffer byteBuffer) Return content ofByteBuffer
as hexadecimal pairs stringcopyToHead
(ByteBuffer buf, int start, int end) Copies portion of the buffer between [start, end) to the head of the ByteBuffer.
-
Constructor Details
-
ByteBufferUtils
public ByteBufferUtils()
-
-
Method Details
-
copyToHead
Copies portion of the buffer between [start, end) to the head of the ByteBuffer. The existing elements will be overwritten.- Returns:
- same buf with position set to the length of the portion shifted
-
asBytes
If inputByteBuffer
is direct (keeps data in native memory) it will copy all data to byte array (inside Java Heap) and return it. Otherwise it will returnByteBuffer.array()
-
asString
Return content ofByteBuffer
as hexadecimal pairs string
-