Class ByteBufferUtils


  • public final class ByteBufferUtils
    extends java.lang.Object
    • Method Summary

      Modifier and Type Method Description
      static long copyBytes​(java.nio.ByteBuffer[] source, java.nio.ByteBuffer destination)
      Copies bytes from the array of byte buffers into the destination buffer.
      static int copyBytes​(java.nio.ByteBuffer source, java.nio.ByteBuffer destination)
      Copies bytes from source byte buffer into the destination buffer.
      • Methods inherited from class java.lang.Object

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

      • copyBytes

        public static long copyBytes​(java.nio.ByteBuffer[] source,
                                     java.nio.ByteBuffer destination)
        Copies bytes from the array of byte buffers into the destination buffer. The number of bytes copied is limited by the bytes available to copy and the space remaining in the destination byte buffer.
        Parameters:
        source - byte buffers to copy from
        destination - byte buffer to copy to
        Returns:
        number of bytes copied
      • copyBytes

        public static int copyBytes​(java.nio.ByteBuffer source,
                                    java.nio.ByteBuffer destination)
        Copies bytes from source byte buffer into the destination buffer. The number of bytes copied is limited by the bytes available to copy and the space remaining in the destination byte buffer.
        Parameters:
        source - byte buffer to copy from
        destination - byte buffer to copy to
        Returns:
        number of bytes copied