Class BufferingResponseListener
java.lang.Object
org.eclipse.jetty.client.AbstractResponseListener
org.eclipse.jetty.client.BufferingResponseListener
- 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
Implementation of AbstractResponseListener that buffers the response content
by copying it up to a maximum length specified to the constructors.
Use RetainingResponseListener for a more efficient
implementation that does not copy the content bytes.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance with a default maximum length of 2 MiB.BufferingResponseListener(int maxLength) Creates an instance with the given maximum length -
Method Summary
Methods inherited from class AbstractResponseListener
getContent, getContentAsInputStream, getContentAsString, getContentAsString, getContentAsString, getEncoding, getMaxLength, getMediaType, onContent, onContent, onFailure, onHeaders, takeContentAsContentSource, takeContentAsInputStreamMethods 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, onSuccess
-
Constructor Details
-
BufferingResponseListener
public BufferingResponseListener()Creates an instance with a default maximum length of 2 MiB. -
BufferingResponseListener
public BufferingResponseListener(int maxLength) Creates an instance with the given maximum length- Parameters:
maxLength- the maximum length of the content
-