|
XNIO API 2.1.0.CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
org.jboss.xnio.channels.ChannelOutputStream
public class ChannelOutputStream

An output stream which writes to a stream sink channel. All write operations are directly performed upon the channel, so for optimal performance, a buffering output stream should be used to wrap this class.
| Field Summary | |
|---|---|
protected StreamSinkChannel |
channel
|
protected boolean |
closed
|
protected long |
timeout
|
| Constructor Summary | |
|---|---|
ChannelOutputStream(StreamSinkChannel channel)
Construct a new instance. |
|
ChannelOutputStream(StreamSinkChannel channel,
long timeout,
TimeUnit unit)
Construct a new instance. |
|
| Method Summary | |
|---|---|
void |
close()
|
void |
flush()
|
long |
getWriteTimeout(TimeUnit unit)
Get the write timeout. |
void |
setWriteTimeout(long timeout,
TimeUnit unit)
Set the write timeout. |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final StreamSinkChannel channel
protected volatile boolean closed
protected volatile long timeout
| Constructor Detail |
|---|
public ChannelOutputStream(StreamSinkChannel channel)
channel - the channel to wrap
public ChannelOutputStream(StreamSinkChannel channel,
long timeout,
TimeUnit unit)
channel - the channel to wraptimeout - the write timeoutunit - the write timeout units| Method Detail |
|---|
public long getWriteTimeout(TimeUnit unit)
unit - the time unit
public void setWriteTimeout(long timeout,
TimeUnit unit)
timeout - the write timeout, or 0 for noneunit - the time unit
public void write(int b)
throws IOException
write in class OutputStreamIOException
public void write(byte[] b)
throws IOException
write in class OutputStreamIOException
public void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOException
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOException
public void close()
throws IOException
close in interface Closeableclose in class OutputStreamIOException
|
XNIO API 2.1.0.CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||