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

public abstract class BufferingResponseListener extends AbstractResponseListener

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 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