| Modifier and Type | Field and Description |
|---|---|
| protected final StreamSourceChannel | |
| private static final int | |
| private static final int | |
| private volatile int | |
| private static final AtomicIntegerFieldUpdater | |
| private volatile long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ChannelInputStream(final StreamSourceChannel
the channel to wrap channel, final long the read timeout, or O for none timeout, final TimeUnit the time unit for read timeouts timeoutUnit)Construct a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this input stream and releases any system resources associated with the stream. |
| private boolean | |
| private void | |
| public long | Returns: the timeout in the given unitthe time unit unit)Get the read timeout. |
| public int | read()
Implements abstract java. Reads the next byte of data from the input stream. |
| public int | read(final byte[]
the buffer into which the data is read. b)Overrides java. Reads some number of bytes from the input stream and stores them into
the buffer array |
| public int | read(final byte[]
the buffer into which the data is read. b, final int the start offset in array off, final int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. Reads up to |
| public void | setReadTimeout(long
the read timeout, or 0 for none timeout, TimeUnit the time unit unit)Set the read timeout. |
| public long | Returns: the number of bytes skipped (0 if the end of stream has been reached)the number of bytes to skip n)Overrides java. Skip bytes in the stream. |
| channel | back to summary |
|---|---|
| protected final StreamSourceChannel channel | |
| FLAG_ENTERED | back to summary |
|---|---|
| private static final int FLAG_ENTERED | |
| FLAG_EOF | back to summary |
|---|---|
| private static final int FLAG_EOF | |
| flags | back to summary |
|---|---|
private volatile int flags
| |
| flagsUpdater | back to summary |
|---|---|
| private static final AtomicIntegerFieldUpdater<ChannelInputStream> flagsUpdater | |
| timeout | back to summary |
|---|---|
| private volatile long timeout | |
| ChannelInputStream | back to summary |
|---|---|
| public ChannelInputStream(final StreamSourceChannel channel) Construct a new instance. The stream will have no read timeout.
| |
| ChannelInputStream | back to summary |
|---|---|
| public ChannelInputStream(final StreamSourceChannel channel, final long timeout, final TimeUnit timeoutUnit) Construct a new instance.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream.
| |
| enter | back to summary |
|---|---|
| private boolean enter() | |
| exit | back to summary |
|---|---|
| private void exit(boolean setEof) | |
| getReadTimeout | back to summary |
|---|---|
| public long getReadTimeout(TimeUnit unit) Get the read timeout.
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(final byte[] b) throws IOException Overrides java. Doc from java. Reads some number of bytes from the input stream and stores them into
the buffer array If the length of The first byte read is stored into element
| |
| read | back to summary |
|---|---|
| public int read(final byte[] b, final int off, final int len) throws IOException Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
| |
| setReadTimeout | back to summary |
|---|---|
| public void setReadTimeout(long timeout, TimeUnit unit) Set the read timeout. Does not affect read operations in progress.
| |
| skip | back to summary |
|---|---|
| public long skip(long n) throws IOException Overrides java. Skip bytes in the stream.
| |