public abstract class AsyncByteConsumer<T> extends org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<T>
HttpAsyncResponseConsumer
implementation that
provides convenience methods for processing of binary content entities enclosed
in an HTTP response.Constructor and Description |
---|
AsyncByteConsumer() |
AsyncByteConsumer(int bufSize) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
onByteReceived(ByteBuffer buf,
org.apache.http.nio.IOControl ioctrl)
Invoked to process a
chunk of content. |
protected void |
onContentReceived(org.apache.http.nio.ContentDecoder decoder,
org.apache.http.nio.IOControl ioctrl) |
protected void |
onEntityEnclosed(HttpEntity entity,
ContentType contentType) |
protected void |
releaseResources() |
buildResult, cancel, close, consumeContent, failed, getContentType, getException, getResult, isDone, onClose, onResponseReceived, responseCompleted, responseReceived
public AsyncByteConsumer(int bufSize)
public AsyncByteConsumer()
protected abstract void onByteReceived(ByteBuffer buf, org.apache.http.nio.IOControl ioctrl) throws IOException
chunk
of content.
The IOControl
interface can be used to suspend input events
if the consumer is temporarily unable to consume more content.buf
- chunk of content.ioctrl
- I/O control of the underlying connection.IOException
- in case of an I/O errorprotected final void onEntityEnclosed(HttpEntity entity, ContentType contentType) throws IOException
onEntityEnclosed
in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<T>
IOException
protected final void onContentReceived(org.apache.http.nio.ContentDecoder decoder, org.apache.http.nio.IOControl ioctrl) throws IOException
onContentReceived
in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<T>
IOException
protected void releaseResources()
releaseResources
in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<T>
Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.