Class ByteBufferUtil

java.lang.Object
io.objectbox.flatbuffers.ByteBufferUtil

public class ByteBufferUtil extends Object
Class that collects utility functions around `ByteBuffer`.
  • Constructor Details

    • ByteBufferUtil

      public ByteBufferUtil()
  • Method Details

    • 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