Package jnr.ffi.util
Class BufferUtil
- java.lang.Object
-
- jnr.ffi.util.BufferUtil
-
public final class BufferUtil extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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
indexOf(java.nio.ByteBuffer buf, int offset, 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
putCharSequence(java.nio.ByteBuffer buf, java.nio.charset.CharsetEncoder encoder, java.lang.CharSequence value)
static void
putCharSequence(java.nio.ByteBuffer buf, java.nio.charset.Charset charset, 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)
-
-
-
Method Detail
-
putString
public static void putString(java.nio.ByteBuffer buf, java.nio.charset.Charset charset, java.lang.String value)
-
getString
public static java.lang.String getString(java.nio.ByteBuffer buf, java.nio.charset.Charset charset)
-
putCharSequence
public static void putCharSequence(java.nio.ByteBuffer buf, java.nio.charset.Charset charset, java.lang.CharSequence value)
-
putCharSequence
public static void putCharSequence(java.nio.ByteBuffer buf, java.nio.charset.CharsetEncoder encoder, java.lang.CharSequence value)
-
getCharSequence
public static java.lang.CharSequence getCharSequence(java.nio.ByteBuffer buf, java.nio.charset.Charset charset)
-
getCharSequence
public static java.lang.CharSequence getCharSequence(java.nio.ByteBuffer buf, java.nio.charset.CharsetDecoder decoder)
-
positionOf
public static int positionOf(java.nio.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 int indexOf(java.nio.ByteBuffer buf, byte value)
-
indexOf
public static int indexOf(java.nio.ByteBuffer buf, int offset, byte value)
-
slice
public static java.nio.ByteBuffer slice(java.nio.ByteBuffer buffer, int position)
-
slice
public static java.nio.ByteBuffer slice(java.nio.ByteBuffer buffer, int position, int size)
-
-