public class ByteBufferUtil
extends java.lang.Object
ByteBuffer.| Constructor and Description |
|---|
ByteBufferUtil() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
array(java.nio.ByteBuffer buf)
Gets a byte array from a buffer.
|
public static final byte[] array(java.nio.ByteBuffer buf)
If the buffer is backed by an array, simply returns the array. Note that this allows modification to the underlying array. Otherwise, the buffer is fully read and returned as a new array.
buf - The buffer. If null, null is returned.