/** * Construct a new ChannelDescriptor with the specified channel, file number, * mode flags, file descriptor object and reference counter. This constructor * is only used when constructing a new copy of an existing ChannelDescriptor * with an existing reference count, to allow the two instances to safely * share and appropriately close a given channel. * * @param channel The channel for the new descriptor, which will be shared with another * @param fileno The new file number for the new descriptor * @param originalModes The mode flags to use as the "origina" set for this descriptor * @param fileDescriptor The java.io.FileDescriptor object to associate with this ChannelDescriptor * @param refCounter The reference counter from another ChannelDescriptor being duped. * @param canBeSeekable If the underlying channel can be considered seekable. * @param isInAppendMode If the underlying channel is already in append mode. */ private ChannelDescriptor(Channel channel, int fileno, ModeFlags originalModes, FileDescriptor fileDescriptor, AtomicInteger refCounter, boolean canBeSeekable, boolean isInAppendMode) { this.refCounter = refCounter; this.channel = channel; this.internalFileno = fileno; this.originalModes = originalModes; this.fileDescriptor = fileDescriptor; this.canBeSeekable = canBeSeekable; this.isInAppendMode = isInAppendMode; this.readableChannel = channel instanceof ReadableByteChannel; this.writableChannel = channel instanceof WritableByteChannel; this.seekableChannel = channel instanceof SeekableByteChannel; registerDescriptor(this); }
/** * Construct a new ChannelDescriptor with the specified channel, file number, * mode flags, file descriptor object and reference counter. This constructor * is only used when constructing a new copy of an existing ChannelDescriptor * with an existing reference count, to allow the two instances to safely * share and appropriately close a given channel. * * @param channel The channel for the new descriptor, which will be shared with another * @param fileno The new file number for the new descriptor * @param originalModes The mode flags to use as the "origina" set for this descriptor * @param fileDescriptor The java.io.FileDescriptor object to associate with this ChannelDescriptor * @param refCounter The reference counter from another ChannelDescriptor being duped. * @param canBeSeekable If the underlying channel can be considered seekable. * @param isInAppendMode If the underlying channel is already in append mode. */ private ChannelDescriptor(Channel channel, int fileno, ModeFlags originalModes, FileDescriptor fileDescriptor, AtomicInteger refCounter, boolean canBeSeekable, boolean isInAppendMode) { this.refCounter = refCounter; this.channel = channel; this.internalFileno = fileno; this.originalModes = originalModes; this.fileDescriptor = fileDescriptor; this.canBeSeekable = canBeSeekable; this.isInAppendMode = isInAppendMode; this.readableChannel = channel instanceof ReadableByteChannel; this.writableChannel = channel instanceof WritableByteChannel; this.seekableChannel = channel instanceof SeekableByteChannel; registerDescriptor(this); }
/** * Construct a new ChannelDescriptor with the specified channel, file number, * mode flags, file descriptor object and reference counter. This constructor * is only used when constructing a new copy of an existing ChannelDescriptor * with an existing reference count, to allow the two instances to safely * share and appropriately close a given channel. * * @param channel The channel for the new descriptor, which will be shared with another * @param fileno The new file number for the new descriptor * @param originalModes The mode flags to use as the "origina" set for this descriptor * @param fileDescriptor The java.io.FileDescriptor object to associate with this ChannelDescriptor * @param refCounter The reference counter from another ChannelDescriptor being duped. * @param canBeSeekable If the underlying channel can be considered seekable. * @param isInAppendMode If the underlying channel is already in append mode. */ private ChannelDescriptor(Channel channel, int fileno, ModeFlags originalModes, FileDescriptor fileDescriptor, AtomicInteger refCounter, boolean canBeSeekable, boolean isInAppendMode) { this.refCounter = refCounter; this.channel = channel; this.internalFileno = fileno; this.originalModes = originalModes; this.fileDescriptor = fileDescriptor; this.canBeSeekable = canBeSeekable; this.isInAppendMode = isInAppendMode; this.readableChannel = channel instanceof ReadableByteChannel; this.writableChannel = channel instanceof WritableByteChannel; this.seekableChannel = channel instanceof FileChannel; registerDescriptor(this); }
/** * Construct a new ChannelDescriptor with the specified channel, file number, * mode flags, file descriptor object and reference counter. This constructor * is only used when constructing a new copy of an existing ChannelDescriptor * with an existing reference count, to allow the two instances to safely * share and appropriately close a given channel. * * @param channel The channel for the new descriptor, which will be shared with another * @param fileno The new file number for the new descriptor * @param originalModes The mode flags to use as the "origina" set for this descriptor * @param fileDescriptor The java.io.FileDescriptor object to associate with this ChannelDescriptor * @param refCounter The reference counter from another ChannelDescriptor being duped. * @param canBeSeekable If the underlying channel can be considered seekable. * @param isInAppendMode If the underlying channel is already in append mode. */ private ChannelDescriptor(Channel channel, int fileno, ModeFlags originalModes, FileDescriptor fileDescriptor, AtomicInteger refCounter, boolean canBeSeekable, boolean isInAppendMode) { this.refCounter = refCounter; this.channel = channel; this.internalFileno = fileno; this.originalModes = originalModes; this.fileDescriptor = fileDescriptor; this.canBeSeekable = canBeSeekable; this.isInAppendMode = isInAppendMode; this.readableChannel = channel instanceof ReadableByteChannel; this.writableChannel = channel instanceof WritableByteChannel; this.seekableChannel = channel instanceof FileChannel; registerDescriptor(this); }