Package org.elasticsearch.nio.utils
Class ByteBufferUtils
- java.lang.Object
-
- org.elasticsearch.nio.utils.ByteBufferUtils
-
public final class ByteBufferUtils extends java.lang.Object
-
-
Method Summary
Modifier and Type Method Description static longcopyBytes(java.nio.ByteBuffer[] source, java.nio.ByteBuffer destination)Copies bytes from the array of byte buffers into the destination buffer.static intcopyBytes(java.nio.ByteBuffer source, java.nio.ByteBuffer destination)Copies bytes from source byte buffer into the destination buffer.
-
-
-
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 fromdestination- 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 fromdestination- byte buffer to copy to- Returns:
- number of bytes copied
-
-