Class RetainingResponseListener
- All Implemented Interfaces:
 EventListener, Response.AsyncContentListener, Response.BeginListener, Response.CompleteListener, Response.ContentListener, Response.ContentSourceListener, Response.FailureListener, Response.HeaderListener, Response.HeadersListener, Response.Listener, Response.ResponseListener, Response.SuccessListener
- Direct Known Subclasses:
 CompletableResponseListener, ContinueProtocolHandler.ContinueListener
Implementation of Response.Listener that retains the response
content without copying it, up to a configurable number of bytes.
The content may be retrieved from AbstractResponseListener.onSuccess(Response) or Response.Listener.onComplete(Result)
via AbstractResponseListener.getContent() or AbstractResponseListener.getContentAsString().
Instances of this class are not reusable, so one must be allocated for each request.
The implementation retains the response content chunks, and converts them into a byte[]
upon response success, returned by AbstractResponseListener.getContent().
Subclasses overriding AbstractResponseListener.onSuccess(Response) or AbstractResponseListener.onFailure(Response, Throwable)
must always call the super method to guarantee that the retained chunks are released.
- 
Constructor Summary
Constructors - 
Method Summary
Methods inherited from class AbstractResponseListener
getContent, getContentAsInputStream, getContentAsString, getContentAsString, getContentAsString, getEncoding, getMaxLength, getMediaType, onContent, onContent, onFailure, onHeaders, onSuccessMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Response.AsyncContentListener
onContentSourceMethods inherited from interface Response.Listener
onBegin, onComplete, onHeader 
- 
Constructor Details
- 
RetainingResponseListener
public RetainingResponseListener() - 
RetainingResponseListener
public RetainingResponseListener(int maxLength)  
 -