public final class BufferUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static long |
getAddress(java.nio.ByteBuffer buf,
int position) |
static java.lang.CharSequence |
getCharSequence(java.nio.ByteBuffer buf,
java.nio.charset.Charset charset) |
static java.lang.CharSequence |
getCharSequence(java.nio.ByteBuffer buf,
java.nio.charset.CharsetDecoder decoder) |
static java.lang.String |
getString(java.nio.ByteBuffer buf,
java.nio.charset.Charset charset) |
static int |
indexOf(java.nio.ByteBuffer buf,
byte value) |
static int |
positionOf(java.nio.ByteBuffer buf,
byte value)
Finds the position of a byte relative to the start of the buffer.
|
static void |
putAddress(java.nio.ByteBuffer buf,
int position,
long address) |
static void |
putCharSequence(java.nio.ByteBuffer buf,
java.nio.charset.Charset charset,
java.lang.CharSequence value) |
static void |
putCharSequence(java.nio.ByteBuffer buf,
java.nio.charset.CharsetEncoder encoder,
java.lang.CharSequence value) |
static void |
putString(java.nio.ByteBuffer buf,
java.nio.charset.Charset charset,
java.lang.String value) |
static java.nio.ByteBuffer |
slice(java.nio.ByteBuffer buffer,
int position) |
static java.nio.ByteBuffer |
slice(java.nio.ByteBuffer buffer,
int position,
int size) |
public static final void putString(java.nio.ByteBuffer buf, java.nio.charset.Charset charset, java.lang.String value)
public static final java.lang.String getString(java.nio.ByteBuffer buf, java.nio.charset.Charset charset)
public static final void putCharSequence(java.nio.ByteBuffer buf, java.nio.charset.Charset charset, java.lang.CharSequence value)
public static final void putCharSequence(java.nio.ByteBuffer buf, java.nio.charset.CharsetEncoder encoder, java.lang.CharSequence value)
public static final java.lang.CharSequence getCharSequence(java.nio.ByteBuffer buf, java.nio.charset.Charset charset)
public static final java.lang.CharSequence getCharSequence(java.nio.ByteBuffer buf, java.nio.charset.CharsetDecoder decoder)
public static final int positionOf(java.nio.ByteBuffer buf, byte value)
buf
- The ByteBuffer to find the value invalue
- The value to locatepublic static final int indexOf(java.nio.ByteBuffer buf, byte value)
public static final long getAddress(java.nio.ByteBuffer buf, int position)
public static final void putAddress(java.nio.ByteBuffer buf, int position, long address)
public static java.nio.ByteBuffer slice(java.nio.ByteBuffer buffer, int position)
public static java.nio.ByteBuffer slice(java.nio.ByteBuffer buffer, int position, int size)