public class MyByteBuffer
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
equalBytes(java.nio.ByteBuffer buffer1,
java.nio.ByteBuffer buffer2)
Returns true if two byte buffers have equal limits, plus equal bytes in all buffer positions before the limit, regardless of the current position() in either buffer.
|
static byte[] |
getBytes(java.nio.ByteBuffer byteBuffer)
Gets the full contents of a byteBuffer (= its bytes from position zero to limit() ) as a byte array.
|
static byte[] |
getRemainingBytes(java.nio.ByteBuffer byteBuffer)
Gets the remaining contents of a byteBuffer (= its bytes from its current position to limit() ) as a byte array.
|
static java.lang.String |
toHex(java.nio.ByteBuffer byteBuffer)
Builds a hexadecimal representation of the contents of any ByteBuffer
|
public static boolean equalBytes(java.nio.ByteBuffer buffer1, java.nio.ByteBuffer buffer2)
buffer1
- The first buffer to be comparedbuffer2
- The secondbuffer to be comparedpublic static java.lang.String toHex(java.nio.ByteBuffer byteBuffer)
byteBuffer
- The bytebufferpublic static byte[] getBytes(java.nio.ByteBuffer byteBuffer)
byteBuffer
- The byteBuffer whose full contents are to be obtained as a byte arraypublic static byte[] getRemainingBytes(java.nio.ByteBuffer byteBuffer)
byteBuffer
- The byteBuffer whose remaining contents are to be obtained as a byte array