Class ByteBufferUtils


  • public class ByteBufferUtils
    extends java.lang.Object
    Utility class for ByteBuffers
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ByteBufferUtils()
      Private constructor for static class
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.nio.ByteBuffer getEmptyByteBuffer()
      Get a ByteBuffer with zero capacity
      static int transferByteBuffer​(java.nio.ByteBuffer source, java.nio.ByteBuffer dest)
      Transfer from one ByteBuffer to another ByteBuffer
      • Methods inherited from class java.lang.Object

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

      • ByteBufferUtils

        private ByteBufferUtils()
        Private constructor for static class
    • Method Detail

      • transferByteBuffer

        public static int transferByteBuffer​(java.nio.ByteBuffer source,
                                             java.nio.ByteBuffer dest)
        Transfer from one ByteBuffer to another ByteBuffer
        Parameters:
        source - the ByteBuffer to copy from
        dest - the ByteBuffer to copy to
        Returns:
        the number of transferred bytes
      • getEmptyByteBuffer

        public static java.nio.ByteBuffer getEmptyByteBuffer()
        Get a ByteBuffer with zero capacity
        Returns:
        empty ByteBuffer