Class AsyncByteConsumer<T>
- java.lang.Object
-
- org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<T>
-
- org.apache.http.nio.client.methods.AsyncByteConsumer<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.apache.http.concurrent.Cancellable,org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>
public abstract class AsyncByteConsumer<T> extends org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<T>HttpAsyncResponseConsumerimplementation that provides convenience methods for processing of binary content entities enclosed in an HTTP response.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBufferbbuf
-
Constructor Summary
Constructors Constructor Description AsyncByteConsumer()AsyncByteConsumer(int bufSize)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidonByteReceived(java.nio.ByteBuffer buf, org.apache.http.nio.IOControl ioctrl)Invoked to process achunkof content.protected voidonContentReceived(org.apache.http.nio.ContentDecoder decoder, org.apache.http.nio.IOControl ioctrl)protected voidonEntityEnclosed(org.apache.http.HttpEntity entity, org.apache.http.entity.ContentType contentType)protected voidreleaseResources()
-
-
-
Method Detail
-
onByteReceived
protected abstract void onByteReceived(java.nio.ByteBuffer buf, org.apache.http.nio.IOControl ioctrl) throws java.io.IOExceptionInvoked to process achunkof content. TheIOControlinterface can be used to suspend input events if the consumer is temporarily unable to consume more content.- Parameters:
buf- chunk of content.ioctrl- I/O control of the underlying connection.- Throws:
java.io.IOException- in case of an I/O error
-
onEntityEnclosed
protected final void onEntityEnclosed(org.apache.http.HttpEntity entity, org.apache.http.entity.ContentType contentType) throws java.io.IOException- Specified by:
onEntityEnclosedin classorg.apache.http.nio.protocol.AbstractAsyncResponseConsumer<T>- Throws:
java.io.IOException
-
onContentReceived
protected final void onContentReceived(org.apache.http.nio.ContentDecoder decoder, org.apache.http.nio.IOControl ioctrl) throws java.io.IOException- Specified by:
onContentReceivedin classorg.apache.http.nio.protocol.AbstractAsyncResponseConsumer<T>- Throws:
java.io.IOException
-
releaseResources
protected void releaseResources()
- Specified by:
releaseResourcesin classorg.apache.http.nio.protocol.AbstractAsyncResponseConsumer<T>
-
-