
public class ChannelOutputStream
extends java.io.OutputStream
| Modifier and Type | Field and Description |
|---|---|
protected StreamSinkChannel |
channel |
protected boolean |
closed |
protected long |
timeout |
| Constructor and Description |
|---|
ChannelOutputStream(StreamSinkChannel channel)
Construct a new instance.
|
ChannelOutputStream(StreamSinkChannel channel,
long timeout,
java.util.concurrent.TimeUnit unit)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
long |
getWriteTimeout(java.util.concurrent.TimeUnit unit)
Get the write timeout.
|
void |
setWriteTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
Set the write timeout.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
protected final StreamSinkChannel channel
protected volatile boolean closed
protected volatile long timeout
public ChannelOutputStream(StreamSinkChannel channel)
channel - the channel to wrappublic ChannelOutputStream(StreamSinkChannel channel, long timeout, java.util.concurrent.TimeUnit unit)
channel - the channel to wraptimeout - the write timeoutunit - the write timeout unitspublic long getWriteTimeout(java.util.concurrent.TimeUnit unit)
unit - the time unitpublic void setWriteTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
timeout - the write timeout, or 0 for noneunit - the time unitpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionCopyright © 2010 JBoss, a division of Red Hat, Inc.