Class ByteBufferUtil


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

      • ByteBufferUtil

        public ByteBufferUtil()
    • 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