Class ByteBufferUtil


  • public class ByteBufferUtil
    extends java.lang.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 int getSizePrefix​(java.nio.ByteBuffer bb)
      Extract the size prefix from a `ByteBuffer`.
      static java.nio.ByteBuffer removeSizePrefix​(java.nio.ByteBuffer bb)
      Create a duplicate of a size-prefixed `ByteBuffer` that has its position advanced just past the size prefix.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByteBufferUtil

        public ByteBufferUtil()
    • Method Detail

      • getSizePrefix

        public static int getSizePrefix​(java.nio.ByteBuffer bb)
        Extract the size prefix from a `ByteBuffer`.
        Parameters:
        bb - a size-prefixed buffer
        Returns:
        the size prefix
      • removeSizePrefix

        public static java.nio.ByteBuffer removeSizePrefix​(java.nio.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