public final class NioUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
freeDirectBuffer(ByteBuffer buffer) |
static FileDescriptor |
getFD(FileChannel fc)
Returns the int file descriptor from within the given FileChannel 'fc'.
|
static FileChannel |
newFileChannel(Closeable ioObject,
FileDescriptor fd,
int mode)
Helps bridge between io and nio.
|
static byte[] |
unsafeArray(ByteBuffer b)
Exposes the array backing a non-direct ByteBuffer, even if the ByteBuffer is read-only.
|
static int |
unsafeArrayOffset(ByteBuffer b)
Exposes the array offset for the array backing a non-direct ByteBuffer,
even if the ByteBuffer is read-only.
|
public static void freeDirectBuffer(ByteBuffer buffer)
public static FileDescriptor getFD(FileChannel fc)
public static FileChannel newFileChannel(Closeable ioObject, FileDescriptor fd, int mode)
public static byte[] unsafeArray(ByteBuffer b)
public static int unsafeArrayOffset(ByteBuffer b)