public abstract class

HttpResponseBodyPart

extends HttpContent
java.lang.Object
   ↳ com.ning.http.client.HttpContent
     ↳ com.ning.http.client.HttpResponseBodyPart
Known Direct Subclasses

Class Overview

A callback class used when an HTTP response body is received.

Summary

[Expand]
Inherited Fields
From class com.ning.http.client.HttpContent
Public Constructors
HttpResponseBodyPart(URI uri, AsyncHttpProvider provider)
Public Methods
abstract boolean closeUnderlyingConnection()
Return true of the underlying connection will be closed once the response has been fully processed.
abstract ByteBuffer getBodyByteBuffer()
Return a ByteBuffer that wraps the actual bytes read from the response's chunk.
abstract byte[] getBodyPartBytes()
Return the response body's part bytes received.
abstract boolean isLast()
Return true if this is the last part.
abstract void markUnderlyingConnectionAsClosed()
Close the underlying connection once the processing has completed.
abstract int writeTo(OutputStream outputStream)
Write the available bytes to the java.io.OutputStream
[Expand]
Inherited Methods
From class com.ning.http.client.HttpContent
From class java.lang.Object

Public Constructors

public HttpResponseBodyPart (URI uri, AsyncHttpProvider provider)

Public Methods

public abstract boolean closeUnderlyingConnection ()

Return true of the underlying connection will be closed once the response has been fully processed.

Returns
  • true of the underlying connection will be closed once the response has been fully processed.

public abstract ByteBuffer getBodyByteBuffer ()

Return a ByteBuffer that wraps the actual bytes read from the response's chunk. The ByteBuffer capacity is equal to the number of bytes available.

Returns
  • ByteBuffer

public abstract byte[] getBodyPartBytes ()

Return the response body's part bytes received.

Returns
  • the response body's part bytes received.

public abstract boolean isLast ()

Return true if this is the last part.

Returns
  • true if this is the last part.

public abstract void markUnderlyingConnectionAsClosed ()

Close the underlying connection once the processing has completed. Invoking that method means the underlying TCP connection will be closed as soon as the processing of the response is completed. That means the underlying connection will never get pooled.

public abstract int writeTo (OutputStream outputStream)

Write the available bytes to the java.io.OutputStream

Returns
  • The number of bytes written
Throws
IOException