com.kenai.jaffl.util
Class BufferUtil
java.lang.Object
com.kenai.jaffl.util.BufferUtil
public final class BufferUtil
- extends Object
Method Summary |
static long |
getAddress(ByteBuffer buf,
int position)
|
static CharSequence |
getCharSequence(ByteBuffer buf,
Charset charset)
|
static CharSequence |
getCharSequence(ByteBuffer buf,
CharsetDecoder decoder)
|
static String |
getString(ByteBuffer buf,
Charset charset)
|
static int |
indexOf(ByteBuffer buf,
byte value)
|
static int |
positionOf(ByteBuffer buf,
byte value)
Finds the position of a byte relative to the start of the buffer. |
static void |
putAddress(ByteBuffer buf,
int position,
long address)
|
static void |
putCharSequence(ByteBuffer buf,
Charset charset,
CharSequence value)
|
static void |
putCharSequence(ByteBuffer buf,
CharsetEncoder encoder,
CharSequence value)
|
static void |
putString(ByteBuffer buf,
Charset charset,
String value)
|
static ByteBuffer |
slice(ByteBuffer buffer,
int position)
|
static ByteBuffer |
slice(ByteBuffer buffer,
int position,
int size)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
putString
public static final void putString(ByteBuffer buf,
Charset charset,
String value)
getString
public static final String getString(ByteBuffer buf,
Charset charset)
putCharSequence
public static final void putCharSequence(ByteBuffer buf,
Charset charset,
CharSequence value)
putCharSequence
public static final void putCharSequence(ByteBuffer buf,
CharsetEncoder encoder,
CharSequence value)
getCharSequence
public static final CharSequence getCharSequence(ByteBuffer buf,
Charset charset)
getCharSequence
public static final CharSequence getCharSequence(ByteBuffer buf,
CharsetDecoder decoder)
positionOf
public static final int positionOf(ByteBuffer buf,
byte value)
- Finds the position of a byte relative to the start of the buffer.
- Parameters:
buf
- The ByteBuffer to find the value invalue
- The value to locate
- Returns:
- The position within the buffer that value is found, or -1 if not
found.
indexOf
public static final int indexOf(ByteBuffer buf,
byte value)
getAddress
public static final long getAddress(ByteBuffer buf,
int position)
putAddress
public static final void putAddress(ByteBuffer buf,
int position,
long address)
slice
public static ByteBuffer slice(ByteBuffer buffer,
int position)
slice
public static ByteBuffer slice(ByteBuffer buffer,
int position,
int size)
Copyright © 2011. All Rights Reserved.