Package jnr.ffi.util
Class BufferUtil
java.lang.Object
jnr.ffi.util.BufferUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic CharSequencegetCharSequence(ByteBuffer buf, Charset charset) static CharSequencegetCharSequence(ByteBuffer buf, CharsetDecoder decoder) static StringgetString(ByteBuffer buf, Charset charset) static intindexOf(ByteBuffer buf, byte value) static intindexOf(ByteBuffer buf, int offset, byte value) static intpositionOf(ByteBuffer buf, byte value) Finds the position of a byte relative to the start of the buffer.static voidputCharSequence(ByteBuffer buf, CharsetEncoder encoder, CharSequence value) static voidputCharSequence(ByteBuffer buf, Charset charset, CharSequence value) static voidputString(ByteBuffer buf, Charset charset, String value) static ByteBufferslice(ByteBuffer buffer, int position) static ByteBufferslice(ByteBuffer buffer, int position, int size)
-
Method Details
-
putString
-
getString
-
putCharSequence
-
putCharSequence
-
getCharSequence
-
getCharSequence
-
positionOf
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
-
indexOf
-
slice
-
slice
-