public class ByteBufferUtils extends Object
Modifier and Type | Method and Description |
---|---|
static ByteBuffer |
deepCopy(ByteBuffer input)
Allocates a new backing byte[] with a new ByteBuffer, and copies the contents of the input buffer to the copy.
|
static ByteBuffer |
toDirectBuffer(ByteBuffer in)
Guarantees a DirectByteBuffer from a ByteBuffer.
|
static int |
transferData(ByteBuffer in,
ByteBuffer out)
Transfers as much data as possible from an input ByteBuffer to an output ByteBuffer
|
public static ByteBuffer deepCopy(ByteBuffer input)
input
- The ByteBuffer to copypublic static int transferData(ByteBuffer in, ByteBuffer out)
in
- The input ByteBufferout
- The output ByteBufferpublic static ByteBuffer toDirectBuffer(ByteBuffer in)
in
- Input ByteBufferCopyright © 2019. All rights reserved.