Package com.google.flatbuffers
Class ByteBufferUtil
- java.lang.Object
-
- com.google.flatbuffers.ByteBufferUtil
-
public class ByteBufferUtil extends Object
Class that collects utility functions around `ByteBuffer`.
-
-
Constructor Summary
Constructors Constructor Description ByteBufferUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetSizePrefix(ByteBuffer bb)Extract the size prefix from a `ByteBuffer`.static ByteBufferremoveSizePrefix(ByteBuffer bb)Create a duplicate of a size-prefixed `ByteBuffer` that has its position advanced just past the size prefix.
-
-
-
Method Detail
-
getSizePrefix
public static int getSizePrefix(ByteBuffer bb)
Extract the size prefix from a `ByteBuffer`.- Parameters:
bb- a size-prefixed buffer- Returns:
- the size prefix
-
removeSizePrefix
public static ByteBuffer removeSizePrefix(ByteBuffer bb)
Create a duplicate of a size-prefixed `ByteBuffer` that has its position advanced just past the size prefix.- Parameters:
bb- a size-prefixed buffer- Returns:
- a new buffer on the same underlying data that has skipped the size prefix
-
-