|
XNIO API 3.0.7.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xnio.channels.BlockingReadableByteChannel
public class BlockingReadableByteChannel
A blocking wrapper for a StreamSourceChannel. Read operations will block until some data may be transferred.
Once any amount of data is read, the operation will return. If a read timeout is specified, then the read methods
will return a 0 if the timeout has elapsed without any data transfer.
| Constructor Summary | |
|---|---|
BlockingReadableByteChannel(StreamSourceChannel delegate)
Construct a new instance. |
|
BlockingReadableByteChannel(StreamSourceChannel delegate,
long readTimeout,
TimeUnit readTimeoutUnit)
Construct a new instance. |
|
| Method Summary | |
|---|---|
void |
close()
|
boolean |
isOpen()
|
int |
read(ByteBuffer dst)
Perform a blocking read operation. |
long |
read(ByteBuffer[] dsts)
Perform a blocking, scattering read operation. |
long |
read(ByteBuffer[] dsts,
int offset,
int length)
Perform a blocking, scattering read operation. |
void |
setReadTimeout(long readTimeout,
TimeUnit readTimeoutUnit)
Set the read timeout. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BlockingReadableByteChannel(StreamSourceChannel delegate)
delegate - the channel to forward I/O operations to
public BlockingReadableByteChannel(StreamSourceChannel delegate,
long readTimeout,
TimeUnit readTimeoutUnit)
delegate - the channel to forward I/O operations toreadTimeout - the read timeoutreadTimeoutUnit - the read timeout unit| Method Detail |
|---|
public void setReadTimeout(long readTimeout,
TimeUnit readTimeoutUnit)
readTimeout - the read timeoutreadTimeoutUnit - the read timeout unit
public long read(ByteBuffer[] dsts,
int offset,
int length)
throws IOException
read in interface ScatteringByteChanneldsts - the destination buffersoffset - the offset into the destination buffer arraylength - the number of buffers to read into
IOException - if an I/O error occurs
public long read(ByteBuffer[] dsts)
throws IOException
read in interface ScatteringByteChanneldsts - the destination buffers
IOException - if an I/O error occurs
public int read(ByteBuffer dst)
throws IOException
read in interface ReadableByteChanneldst - the destination buffer
IOException - if an I/O error occurspublic boolean isOpen()
isOpen in interface Channel
public void close()
throws IOException
close in interface Closeableclose in interface ChannelIOException
|
XNIO API 3.0.7.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||