Package java.nio

Class NioUtils

java.lang.Object
java.nio.NioUtils

public final class NioUtils
extends Object
  • Method Details

    • freeDirectBuffer

      public static void freeDirectBuffer​(ByteBuffer buffer)
    • getFD

      public static FileDescriptor getFD​(FileChannel fc)
      Returns the int file descriptor from within the given FileChannel 'fc'.
    • newFileChannel

      public static FileChannel newFileChannel​(Object stream, FileDescriptor fd, int mode)
      Helps bridge between io and nio.
    • unsafeArray

      public static byte[] unsafeArray​(ByteBuffer b)
      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

      public static int unsafeArrayOffset​(ByteBuffer b)
      Exposes the array offset for the array backing a non-direct ByteBuffer, even if the ByteBuffer is read-only.