Class ByteBufferUtils

java.lang.Object
org.elasticsearch.nio.utils.ByteBufferUtils

public final class ByteBufferUtils extends Object
  • Method Details

    • copyBytes

      public static long copyBytes(ByteBuffer[] source, 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(ByteBuffer source, 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