public class ByteBuffers
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<java.nio.ByteBuffer> |
LEXICOGRAPHIC_COMPARATOR |
Constructor and Description |
---|
ByteBuffers() |
Modifier and Type | Method and Description |
---|---|
static java.nio.ByteBuffer |
copyRemaining(java.nio.ByteBuffer src)
Copies the remaining bytes form src to a new byte buffer.
|
static byte[] |
copyRemainingBytes(java.nio.ByteBuffer src)
Copies the remaining bytes form src to a byte array.
|
static void |
copyTo(java.nio.ByteBuffer src,
java.nio.ByteBuffer dest)
Copies all remaining bytes from src to dest.
|
static java.nio.ByteBuffer |
copyWithPrefix(byte prefix,
java.nio.ByteBuffer src) |
static java.lang.String |
getString(java.nio.ByteBuffer buf)
Read the remaining bytes from a bytebuffer as a string
|
public static final java.util.Comparator<java.nio.ByteBuffer> LEXICOGRAPHIC_COMPARATOR
public static void copyTo(java.nio.ByteBuffer src, java.nio.ByteBuffer dest)
Copies all remaining bytes from src to dest. This is done without modifying the src's position. However, the dest's position is updated.
src
- the buffer to copy from. its position will not be updated.dest
- the buffer to copy to. its position will be updated.public static java.nio.ByteBuffer copyWithPrefix(byte prefix, java.nio.ByteBuffer src)
public static java.nio.ByteBuffer copyRemaining(java.nio.ByteBuffer src)
public static byte[] copyRemainingBytes(java.nio.ByteBuffer src)
public static java.lang.String getString(java.nio.ByteBuffer buf)