Package java.nio
Class NioUtils
java.lang.Object
java.nio.NioUtils
public final class NioUtils extends Object
-
Method Summary
Modifier and Type Method Description static voidfreeDirectBuffer(ByteBuffer buffer)static FileDescriptorgetFD(FileChannel fc)Returns the int file descriptor from within the given FileChannel 'fc'.static FileChannelnewFileChannel(Object stream, 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 intunsafeArrayOffset(ByteBuffer b)Exposes the array offset for the array backing a non-direct ByteBuffer, even if the ByteBuffer is read-only.
-
Method Details
-
freeDirectBuffer
-
getFD
Returns the int file descriptor from within the given FileChannel 'fc'. -
newFileChannel
Helps bridge between io and nio. -
unsafeArray
Exposes the array backing a non-direct ByteBuffer, even if the ByteBuffer is read-only. Normally, attempting to access the array backing a read-only buffer throws. -
unsafeArrayOffset
Exposes the array offset for the array backing a non-direct ByteBuffer, even if the ByteBuffer is read-only.
-