| Modifier and Type | Field and Description |
|---|---|
| private final FileDescriptor | |
| private final int | |
| private volatile boolean | |
| private static final NativeDispatcher | |
| private Thread | |
| private final ReentrantLock | |
| private static final int | |
| private static final int | |
| private static final int | |
| private int | |
| private final Object |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | configureSocketNonBlockingIfVirtualThread()
Ensures that the socket is configured non-blocking when on a virtual thread. |
| private void | endRead(boolean blocking, boolean completed)
Marks the end of a read operation that may have blocked. |
| private void | |
| public FileDescriptor | |
| public int | |
| private void | |
| private void | |
| protected void | implCloseSelectableChannel()
Implements abstract java. Invoked by implCloseChannel to close the channel. |
| protected void | implConfigureBlocking(boolean block)
Implements abstract java. Adjusts this channel's blocking mode. |
| public void | |
| public int | read(ByteBuffer dst)
Implements java. Reads a sequence of bytes from this channel into the given buffer. |
| public long | read(ByteBuffer[] dsts, int offset, int length)
Implements java. Reads a sequence of bytes from this channel into a subsequence of the given buffers. |
| public long | read(ByteBuffer[] dsts)
Implements java. Reads a sequence of bytes from this channel into the given buffers. |
| public boolean | translateAndSetReadyOps(int ops, SelectionKeyImpl ski)
Implements sun. Sets the specified ops if present in interestOps. |
| public boolean | translateAndUpdateReadyOps(int ops, SelectionKeyImpl ski)
Implements sun. Adds the specified ops if present in interestOps. |
| public int | translateInterestOps(int ops)
Implements sun. Translates an interest operation set into a native event set |
| public boolean | |
| private boolean | tryClose()
Closes the read end of the pipe if there are no read operation in progress and the channel is not registered with a Selector. |
| private void |
| fd | back to summary |
|---|---|
| private final FileDescriptor fd | |
| fdVal | back to summary |
|---|---|
| private final int fdVal | |
| forcedNonBlocking | back to summary |
|---|---|
| private volatile boolean forcedNonBlocking | |
| nd | back to summary |
|---|---|
| private static final NativeDispatcher nd | |
| readerThread | back to summary |
|---|---|
| private Thread readerThread | |
| readLock | back to summary |
|---|---|
| private final ReentrantLock readLock | |
| ST_CLOSED | back to summary |
|---|---|
| private static final int ST_CLOSED | |
| ST_CLOSING | back to summary |
|---|---|
| private static final int ST_CLOSING | |
| ST_INUSE | back to summary |
|---|---|
| private static final int ST_INUSE | |
| state | back to summary |
|---|---|
| private int state | |
| stateLock | back to summary |
|---|---|
| private final Object stateLock | |
| SourceChannelImpl | back to summary |
|---|---|
| pack-priv SourceChannelImpl(SelectorProvider sp, FileDescriptor fd) throws IOException | |
| beginRead | back to summary |
|---|---|
| private void beginRead(boolean blocking) throws ClosedChannelException Marks the beginning of a read operation that might block.
| |
| configureSocketNonBlockingIfVirtualThread | back to summary |
|---|---|
| private void configureSocketNonBlockingIfVirtualThread() throws IOException Ensures that the socket is configured non-blocking when on a virtual thread. | |
| endRead | back to summary |
|---|---|
| private void endRead(boolean blocking, boolean completed) throws AsynchronousCloseException Marks the end of a read operation that may have blocked.
| |
| ensureOpen | back to summary |
|---|---|
| private void ensureOpen() throws ClosedChannelException Checks that the channel is open.
| |
| getFD | back to summary |
|---|---|
| public FileDescriptor getFD() Implements sun. | |
| getFDVal | back to summary |
|---|---|
| public int getFDVal() Implements sun. | |
| implCloseBlockingMode | back to summary |
|---|---|
| private void implCloseBlockingMode() throws IOException Closes this channel when configured in blocking mode. If there is a read operation in progress then the read-end of the pipe is pre-closed and the reader is signalled, in which case the final close is deferred until the reader aborts. | |
| implCloseNonBlockingMode | back to summary |
|---|---|
| private void implCloseNonBlockingMode() throws IOException Closes this channel when configured in non-blocking mode. If the channel is registered with a Selector then the close is deferred until the channel is flushed from all Selectors. | |
| implCloseSelectableChannel | back to summary |
|---|---|
| protected void implCloseSelectableChannel() throws IOException Implements abstract java. Invoked by implCloseChannel to close the channel.
| |
| implConfigureBlocking | back to summary |
|---|---|
| protected void implConfigureBlocking(boolean block) throws IOException Implements abstract java. Doc from java. Adjusts this channel's blocking mode. This method is invoked by the
| |
| kill | back to summary |
|---|---|
| public void kill() Implements sun.
| |
| read | back to summary |
|---|---|
| public int read(ByteBuffer dst) throws IOException Implements java. Doc from java. Reads a sequence of bytes from this channel into the given buffer. An attempt is made to read up to r bytes from the channel,
where r is the number of bytes remaining in the buffer, that is,
Suppose that a byte sequence of length n is read, where
A read operation might not fill the buffer, and in fact it might not read any bytes at all. Whether or not it does so depends upon the nature and state of the channel. A socket channel in non-blocking mode, for example, cannot read any more bytes than are immediately available from the socket's input buffer; similarly, a file channel cannot read any more bytes than remain in the file. It is guaranteed, however, that if a channel is in blocking mode and there is at least one byte remaining in the buffer then this method will block until at least one byte is read. This method may be invoked at any time. If another thread has already initiated a read operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| read | back to summary |
|---|---|
| public long read(ByteBuffer[] dsts, int offset, int length) throws IOException Implements java. Doc from java. Reads a sequence of bytes from this channel into a subsequence of the given buffers. An invocation of this method attempts to read up to r bytes from this channel, where r is the total number of bytes remaining in the specified subsequence of the given buffer array, that is, dsts[offset].remaining() + dsts[offset+1].remaining() + ... + dsts[offset+length-1].remaining() Suppose that a byte sequence of length n is read, where
This method may be invoked at any time. If another thread has already initiated a read operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| read | back to summary |
|---|---|
| public long read(ByteBuffer[] dsts) throws IOException Implements java. Doc from java. Reads a sequence of bytes from this channel into the given buffers. An invocation of this method of the form c.read(dsts, 0, dsts.length);
| |
| translateAndSetReadyOps | back to summary |
|---|---|
| public boolean translateAndSetReadyOps(int ops, SelectionKeyImpl ski) Implements sun. Doc from sun. Sets the specified ops if present in interestOps. The specified ops are turned on, and all other ops are turned off. | |
| translateAndUpdateReadyOps | back to summary |
|---|---|
| public boolean translateAndUpdateReadyOps(int ops, SelectionKeyImpl ski) Implements sun. Doc from sun. Adds the specified ops if present in interestOps. The specified ops are turned on without affecting the other ops. | |
| translateInterestOps | back to summary |
|---|---|
| public int translateInterestOps(int ops) Implements sun. Doc from sun. Translates an interest operation set into a native event set | |
| translateReadyOps | back to summary |
|---|---|
| public boolean translateReadyOps(int ops, int initialOps, SelectionKeyImpl ski) | |
| tryClose | back to summary |
|---|---|
| private boolean tryClose() throws IOException Closes the read end of the pipe if there are no read operation in progress and the channel is not registered with a Selector. | |
| tryFinishClose | back to summary |
|---|---|
| private void tryFinishClose() Invokes tryClose to attempt to close the read end of the pipe. This method is used for deferred closing by I/O and Selector operations. | |