Package org.java_websocket.util
Class ByteBufferUtils
- java.lang.Object
-
- org.java_websocket.util.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 capacitystatic int
transferByteBuffer(java.nio.ByteBuffer source, java.nio.ByteBuffer dest)
Transfer from one ByteBuffer to another ByteBuffer
-
-
-
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 fromdest
- 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
-
-