public abstract class AsyncCharConsumer<T> extends org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<T>
HttpAsyncResponseConsumer
implementation that
provides convenience methods for processing of textual content entities enclosed
in an HTTP response.Constructor and Description |
---|
AsyncCharConsumer() |
AsyncCharConsumer(int bufSize) |
Modifier and Type | Method and Description |
---|---|
protected CharsetDecoder |
createDecoder(ContentType contentType)
Invoked to create a @{link CharsetDecoder} for contentType.
|
protected abstract void |
onCharReceived(CharBuffer 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 AsyncCharConsumer(int bufSize)
public AsyncCharConsumer()
protected abstract void onCharReceived(CharBuffer 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 CharsetDecoder createDecoder(ContentType contentType)
contentType
- response Content-Type or null if not specified.protected 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.