Package jnr.ffi.util
Class BufferUtil
java.lang.Object
jnr.ffi.util.BufferUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
indexOf
(ByteBuffer buf, int offset, byte value) static int
positionOf
(ByteBuffer buf, byte value) Finds the position of a byte relative to the start of the buffer.static void
putCharSequence
(ByteBuffer buf, CharsetEncoder encoder, CharSequence value) static void
putCharSequence
(ByteBuffer buf, Charset charset, 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)
-
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
-