| Modifier and Type | Field and Description |
|---|---|
| protected final StreamSinkChannel | |
| private static final int | |
| private static final int | |
| private volatile int | |
| private static final AtomicIntegerFieldUpdater | |
| private volatile long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ChannelOutputStream(final StreamSinkChannel
the channel to wrap channel, final long the write timeout timeout, final TimeUnit the write timeout units unit)Construct a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| private boolean | |
| private void | |
| public void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out. |
| public long | Returns: the timeout in the given unitthe time unit unit)Get the write timeout. |
| public void | setWriteTimeout(long
the write timeout, or 0 for none timeout, TimeUnit the time unit unit)Set the write timeout. |
| public void | write(final int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| public void | write(final byte[]
the data. b)Overrides java. Writes |
| public void | write(final byte[]
the data. b, final int the start offset in the data. off, final int the number of bytes to write. len)Overrides java. Writes |
| channel | back to summary |
|---|---|
| protected final StreamSinkChannel channel | |
| FLAG_CLOSED | back to summary |
|---|---|
| private static final int FLAG_CLOSED | |
| FLAG_ENTERED | back to summary |
|---|---|
| private static final int FLAG_ENTERED | |
| flags | back to summary |
|---|---|
private volatile int flags
| |
| flagsUpdater | back to summary |
|---|---|
| private static final AtomicIntegerFieldUpdater<ChannelOutputStream> flagsUpdater | |
| timeout | back to summary |
|---|---|
| private volatile long timeout | |
| ChannelOutputStream | back to summary |
|---|---|
| public ChannelOutputStream(final StreamSinkChannel channel) Construct a new instance. No write timeout is configured.
| |
| ChannelOutputStream | back to summary |
|---|---|
| public ChannelOutputStream(final StreamSinkChannel channel, final long timeout, final TimeUnit unit) Construct a new instance.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| enter | back to summary |
|---|---|
| private boolean enter() | |
| exit | back to summary |
|---|---|
| private void exit(boolean setEof) | |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| getWriteTimeout | back to summary |
|---|---|
| public long getWriteTimeout(TimeUnit unit) Get the write timeout.
| |
| setWriteTimeout | back to summary |
|---|---|
| public void setWriteTimeout(long timeout, TimeUnit unit) Set the write timeout. Does not affect write operations in progress.
| |
| write | back to summary |
|---|---|
| public void write(final int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(final byte[] b) throws IOException Overrides java. Doc from java. Writes
| |
| write | back to summary |
|---|---|
| public void write(final byte[] b, final int off, final int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |