public class AsyncStreamingInputPlus extends RebufferingInputStream
| Modifier and Type | Class and Description |
|---|---|
static interface |
AsyncStreamingInputPlus.Consumer |
static class |
AsyncStreamingInputPlus.InputTimeoutException |
DataInputPlus.DataInputStreamPlusbuffer| Constructor and Description |
|---|
AsyncStreamingInputPlus(io.netty.channel.Channel channel) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
append(io.netty.buffer.ByteBuf buf)
Append a
ByteBuf to the end of the einternal queue. |
void |
close()
Note: This should invoked on the consuming thread.
|
void |
consume(AsyncStreamingInputPlus.Consumer consumer,
long length)
Consumes bytes in the stream until the given length
|
io.netty.buffer.ByteBufAllocator |
getAllocator() |
boolean |
isEmpty() |
void |
maybeIssueRead() |
protected void |
reBuffer()
Implementations must implement this method to refill the buffer.
|
void |
requestClosure()
Mark this stream as closed, but do not release any of the resources.
|
int |
unsafeAvailable()
As long as this method is invoked on the consuming thread the returned value will be accurate.
|
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readFully, readInt, readLine, readLong, readPrimitiveSlowly, readShort, readUnsignedByte, readUnsignedShort, readUnsignedVInt, readUTF, readVInt, skipBytesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitskipBytesFullypublic AsyncStreamingInputPlus(io.netty.channel.Channel channel)
public boolean append(io.netty.buffer.ByteBuf buf)
throws java.lang.IllegalStateException
ByteBuf to the end of the einternal queue.
Note: it's expected this method is invoked on the netty event loop.java.lang.IllegalStateExceptionprotected void reBuffer()
throws java.io.EOFException,
AsyncStreamingInputPlus.InputTimeoutException
queue for more data.
This is best, and more or less expected, to be invoked on a consuming thread (not the event loop) becasue if we block on the queue we can't fill it on the event loop (as that's where the buffers are coming from).
reBuffer in class RebufferingInputStreamjava.io.EOFException - when no further reading from this instance should occur. Implies this instance is closed.AsyncStreamingInputPlus.InputTimeoutException - when no new buffers arrive for reading before
the rebufferTimeoutNanos elapses while blocking. It's then not safe to reuse this instance again.public void consume(AsyncStreamingInputPlus.Consumer consumer, long length) throws java.io.IOException
java.io.IOExceptionpublic int unsafeAvailable()
public void maybeIssueRead()
public boolean isEmpty()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreampublic void requestClosure()
public io.netty.buffer.ByteBufAllocator getAllocator()
Copyright © 2009-2022 The Apache Software Foundation