public class ReadableByteChannelFromBlockingQueue extends Object implements ReadableByteChannel
| Modifier and Type | Field and Description |
|---|---|
protected Throwable |
abortException |
protected BlockingQueue<ByteBuffer> |
clientQueue |
protected Runnable |
closeAction |
protected ByteBuffer |
currentBuffer |
protected boolean |
isOpen |
protected static ByteBuffer |
POISON |
| Constructor and Description |
|---|
ReadableByteChannelFromBlockingQueue() |
ReadableByteChannelFromBlockingQueue(Runnable closeAction) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Supply data to the channel, which will be returned by read operations in sequence
|
void |
complete() |
boolean |
isComplete() |
boolean |
isOpen() |
void |
put(ByteBuffer bodyBuffer) |
int |
read(ByteBuffer dst) |
protected static final ByteBuffer POISON
protected BlockingQueue<ByteBuffer> clientQueue
protected ByteBuffer currentBuffer
protected Throwable abortException
protected boolean isOpen
protected Runnable closeAction
public ReadableByteChannelFromBlockingQueue()
public ReadableByteChannelFromBlockingQueue(Runnable closeAction)
public boolean isComplete()
public void complete()
public void put(ByteBuffer bodyBuffer)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface Channeldata - IOExceptionpublic int read(ByteBuffer dst)
read in interface ReadableByteChannelCopyright © 2020. All rights reserved.