26 package sun.nio.ch;
27
28 import java.io.FileDescriptor;
29 import java.io.IOException;
30 import java.io.UncheckedIOException;
31 import java.lang.ref.Cleaner.Cleanable;
32 import java.nio.ByteBuffer;
33 import java.nio.MappedByteBuffer;
34 import java.nio.channels.AsynchronousCloseException;
35 import java.nio.channels.ClosedByInterruptException;
36 import java.nio.channels.ClosedChannelException;
37 import java.nio.channels.FileChannel;
38 import java.nio.channels.FileLock;
39 import java.nio.channels.FileLockInterruptionException;
40 import java.nio.channels.NonReadableChannelException;
41 import java.nio.channels.NonWritableChannelException;
42 import java.nio.channels.ReadableByteChannel;
43 import java.nio.channels.SelectableChannel;
44 import java.nio.channels.WritableByteChannel;
45
46 import jdk.internal.misc.JavaIOFileDescriptorAccess;
47 import jdk.internal.misc.JavaNioAccess;
48 import jdk.internal.misc.SharedSecrets;
49 import jdk.internal.ref.Cleaner;
50 import jdk.internal.ref.CleanerFactory;
51
52 public class FileChannelImpl
53 extends FileChannel
54 {
55 // Memory allocation size for mapping buffers
56 private static final long allocationGranularity;
57
58 // Access to FileDescriptor internals
59 private static final JavaIOFileDescriptorAccess fdAccess =
60 SharedSecrets.getJavaIOFileDescriptorAccess();
61
62 // Used to make native read and write calls
63 private final FileDispatcher nd;
64
65 // File descriptor
66 private final FileDescriptor fd;
67
68 // File access mode (immutable)
|
26 package sun.nio.ch;
27
28 import java.io.FileDescriptor;
29 import java.io.IOException;
30 import java.io.UncheckedIOException;
31 import java.lang.ref.Cleaner.Cleanable;
32 import java.nio.ByteBuffer;
33 import java.nio.MappedByteBuffer;
34 import java.nio.channels.AsynchronousCloseException;
35 import java.nio.channels.ClosedByInterruptException;
36 import java.nio.channels.ClosedChannelException;
37 import java.nio.channels.FileChannel;
38 import java.nio.channels.FileLock;
39 import java.nio.channels.FileLockInterruptionException;
40 import java.nio.channels.NonReadableChannelException;
41 import java.nio.channels.NonWritableChannelException;
42 import java.nio.channels.ReadableByteChannel;
43 import java.nio.channels.SelectableChannel;
44 import java.nio.channels.WritableByteChannel;
45
46 import jdk.internal.access.JavaIOFileDescriptorAccess;
47 import jdk.internal.access.JavaNioAccess;
48 import jdk.internal.access.SharedSecrets;
49 import jdk.internal.ref.Cleaner;
50 import jdk.internal.ref.CleanerFactory;
51
52 public class FileChannelImpl
53 extends FileChannel
54 {
55 // Memory allocation size for mapping buffers
56 private static final long allocationGranularity;
57
58 // Access to FileDescriptor internals
59 private static final JavaIOFileDescriptorAccess fdAccess =
60 SharedSecrets.getJavaIOFileDescriptorAccess();
61
62 // Used to make native read and write calls
63 private final FileDispatcher nd;
64
65 // File descriptor
66 private final FileDescriptor fd;
67
68 // File access mode (immutable)
|