Top Constructors Methods
jnr.ffi.util

public final Class BufferUtil

extends Object
Class Inheritance
Imports
java.nio.ByteBuffer, .CharBuffer, java.nio.charset.CharacterCodingException, .Charset, .CharsetDecoder, .CharsetEncoder, .CodingErrorAction

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static CharSequence
public static CharSequence
getCharSequence(final ByteBuffer buf, final CharsetDecoder decoder)

public static String
public static int
indexOf(ByteBuffer buf, byte value)

public static int
indexOf(ByteBuffer buf, int offset, byte value)

public static int

Returns:

The position within the buffer that value is found, or -1 if not found.
positionOf
(ByteBuffer
The ByteBuffer to find the value in
buf
,
byte
The value to locate
value
)

Finds the position of a byte relative to the start of the buffer.

public static void
public static void
public static void
putString(ByteBuffer buf, Charset charset, String value)

public static ByteBuffer
slice(final ByteBuffer buffer, final int position)

public static ByteBuffer
slice(final ByteBuffer buffer, final int position, final int size)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BufferUtilback to summary
private BufferUtil()

Method Detail

getCharSequenceback to summary
public static CharSequence getCharSequence(ByteBuffer buf, Charset charset)
getCharSequenceback to summary
public static CharSequence getCharSequence(final ByteBuffer buf, final CharsetDecoder decoder)
getStringback to summary
public static String getString(ByteBuffer buf, Charset charset)
indexOfback to summary
public static int indexOf(ByteBuffer buf, byte value)
indexOfback to summary
public static int indexOf(ByteBuffer buf, int offset, byte value)
positionOfback to summary
public static int positionOf(ByteBuffer buf, byte value)

Finds the position of a byte relative to the start of the buffer.

Parameters
buf:ByteBuffer

The ByteBuffer to find the value in

value:byte

The value to locate

Returns:int

The position within the buffer that value is found, or -1 if not found.

putCharSequenceback to summary
public static void putCharSequence(ByteBuffer buf, Charset charset, CharSequence value)
putCharSequenceback to summary
public static void putCharSequence(ByteBuffer buf, CharsetEncoder encoder, CharSequence value)
putStringback to summary
public static void putString(ByteBuffer buf, Charset charset, String value)
sliceback to summary
public static ByteBuffer slice(final ByteBuffer buffer, final int position)
sliceback to summary
public static ByteBuffer slice(final ByteBuffer buffer, final int position, final int size)