Pipe, natively implemented.
| Modifier and Type | Class and Description |
|---|---|
| public class | AFPipe.
A channel representing the writable end of a |
| public class | AFPipe.
A channel representing the readable end of a |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final AFSupplier | |
| private final int | |
| private final AFPipe. | |
| private final AFCore | |
| private final AFPipe. | |
| private final AFCore |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements java. Closes this stream and releases any system resources associated with it. |
| pack-priv int | Returns: The options.Returns the options bitmask that is to be passed to native receive/send calls. |
| public static AFPipe | |
| public AFPipe. | |
| pack-priv FileDescriptor | |
| public AFPipe. | |
| pack-priv FileDescriptor |
| DUMMY_TIMEOUT | back to summary |
|---|---|
| pack-priv static final AFSupplier<Integer> DUMMY_TIMEOUT | |
| options | back to summary |
|---|---|
| private final int options | |
| sinkChannel | back to summary |
|---|---|
| private final AFPipe. | |
| sinkCore | back to summary |
|---|---|
| private final AFCore sinkCore | |
| sourceChannel | back to summary |
|---|---|
| private final AFPipe. | |
| sourceCore | back to summary |
|---|---|
| private final AFCore sourceCore | |
| AFPipe | back to summary |
|---|---|
| pack-priv AFPipe(AFSelectorProvider<?> provider, boolean selectable) throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| getOptions | back to summary |
|---|---|
| pack-priv int getOptions() Returns the options bitmask that is to be passed to native receive/send calls.
| |
| open | back to summary |
|---|---|
| public static AFPipe open() throws IOException Hides java. Opens an
| |
| sink | back to summary |
|---|---|
| public AFPipe. Implements abstract java. Doc from java. Returns this pipe's sink channel.
| |
| sinkFD | back to summary |
|---|---|
| pack-priv FileDescriptor sinkFD() | |
| source | back to summary |
|---|---|
| public AFPipe. Implements abstract java. Doc from java. Returns this pipe's source channel.
| |
| sourceFD | back to summary |
|---|---|
| pack-priv FileDescriptor sourceFD() | |
Pipe, with access to the
FileDescriptor.
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public FileDescriptor | getFileDescriptor()
Implements org. Returns the corresponding |
| protected void | implCloseSelectableChannel()
Implements abstract java. Closes this selectable channel. |
| protected void | implConfigureBlocking(boolean
If block)true then this channel will be placed in
blocking mode; if false then it will be placed
non-blocking modeImplements abstract java. Adjusts this channel's blocking mode. |
| public long | write(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs, int The offset within the buffer array of the first buffer from
which bytes are to be retrieved; must be non-negative and no
larger than offset, int srcs.lengthThe maximum number of buffers to be accessed; must be
non-negative and no larger than
length)srcs.length - offsetImplements java. Writes a sequence of bytes to this channel from a subsequence of the given buffers. |
| public long | write(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs)Implements java. Writes a sequence of bytes to this channel from the given buffers. |
| public int | write(ByteBuffer
The buffer from which bytes are to be retrieved src)Implements java. Writes a sequence of bytes to this channel from the given buffer. |
| SinkChannel | back to summary |
|---|---|
| pack-priv SinkChannel(SelectorProvider provider) | |
| getFileDescriptor | back to summary |
|---|---|
| public FileDescriptor getFileDescriptor() throws IOException Implements org. Doc from org. Returns the corresponding
| |
| implCloseSelectableChannel | back to summary |
|---|---|
| protected void implCloseSelectableChannel() throws IOException Implements abstract java. Doc from java. Closes this selectable channel. This method is invoked by the An implementation of this method must arrange for any other thread that is blocked in an I/O operation upon this channel to return immediately, either by throwing an exception or by returning normally.
| |
| 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
| |
| write | back to summary |
|---|---|
| public long write(ByteBuffer[] srcs, int offset, int length) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from a subsequence of the given buffers. An attempt is made to write up to r bytes to this channel, where r is the total number of bytes remaining in the specified subsequence of the given buffer array, that is, srcs[offset].remaining() + srcs[offset+1].remaining() + ... + srcs[offset+length-1].remaining() Suppose that a byte sequence of length n is written, where
Unless otherwise specified, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer. This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| write | back to summary |
|---|---|
| public long write(ByteBuffer[] srcs) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffers. An invocation of this method of the form c.write(srcs, 0, srcs.length);
| |
| write | back to summary |
|---|---|
| public int write(ByteBuffer src) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffer. An attempt is made to write up to r bytes to the channel,
where r is the number of bytes remaining in the buffer, that is,
Suppose that a byte sequence of length n is written, where
Unless otherwise specified, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer. This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
Pipe, with access to the
FileDescriptor.
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public FileDescriptor | getFileDescriptor()
Implements org. Returns the corresponding |
| protected void | implCloseSelectableChannel()
Implements abstract java. Closes this selectable channel. |
| protected void | implConfigureBlocking(boolean
If block)true then this channel will be placed in
blocking mode; if false then it will be placed
non-blocking modeImplements abstract java. Adjusts this channel's blocking mode. |
| public long | read(ByteBuffer[]
The buffers into which bytes are to be transferred dsts, int The offset within the buffer array of the first buffer into
which bytes are to be transferred; must be non-negative and no
larger than offset, int dsts.lengthThe maximum number of buffers to be accessed; must be
non-negative and no larger than
length)dsts.length - offsetImplements java. Reads a sequence of bytes from this channel into a subsequence of the given buffers. |
| public long | read(ByteBuffer[]
The buffers into which bytes are to be transferred dsts)Implements java. Reads a sequence of bytes from this channel into the given buffers. |
| public int | read(ByteBuffer
The buffer into which bytes are to be transferred dst)Implements java. Reads a sequence of bytes from this channel into the given buffer. |
| SourceChannel | back to summary |
|---|---|
| pack-priv SourceChannel(SelectorProvider provider) | |
| getFileDescriptor | back to summary |
|---|---|
| public FileDescriptor getFileDescriptor() throws IOException Implements org. Doc from org. Returns the corresponding
| |
| implCloseSelectableChannel | back to summary |
|---|---|
| protected void implCloseSelectableChannel() throws IOException Implements abstract java. Doc from java. Closes this selectable channel. This method is invoked by the An implementation of this method must arrange for any other thread that is blocked in an I/O operation upon this channel to return immediately, either by throwing an exception or by returning normally.
| |
| 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
| |
| 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);
| |
| 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.
| |