|
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.InputStream
org.jboss.xnio.channels.ChannelInputStream
public class ChannelInputStream

An input stream which reads from a stream source channel. All read operations are directly performed upon the channel, so for optimal performance, a buffering input stream should be used to wrap this class.
| Field Summary | |
|---|---|
protected StreamSourceChannel |
channel
|
protected boolean |
closed
|
protected long |
timeout
|
| Constructor Summary | |
|---|---|
ChannelInputStream(StreamSourceChannel channel)
Construct a new instance. |
|
ChannelInputStream(StreamSourceChannel channel,
long timeout,
TimeUnit timeoutUnit)
Construct a new instance. |
|
| Method Summary | |
|---|---|
void |
close()
|
long |
getReadTimeout(TimeUnit unit)
Get the read timeout. |
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
void |
setReadTimeout(long timeout,
TimeUnit unit)
Set the read timeout. |
| Methods inherited from class java.io.InputStream |
|---|
available, mark, markSupported, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final StreamSourceChannel channel
protected volatile boolean closed
protected volatile long timeout
| Constructor Detail |
|---|
public ChannelInputStream(StreamSourceChannel channel)
channel - the channel to wrap
public ChannelInputStream(StreamSourceChannel channel,
long timeout,
TimeUnit timeoutUnit)
channel - the channel to wraptimeout - the read timeout, or O for nonetimeoutUnit - the time unit for read timeouts| Method Detail |
|---|
public long getReadTimeout(TimeUnit unit)
unit - the time unit
public void setReadTimeout(long timeout,
TimeUnit unit)
timeout - the read timeout, or 0 for noneunit - the time unit
public int read()
throws IOException
read in class InputStreamIOException
public int read(byte[] b)
throws IOException
read in class InputStreamIOException
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOException
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException
|
XNIO API 2.1.0.CR2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||