com.ning.http.client
Class HttpResponseBodyPart

java.lang.Object
  extended by com.ning.http.client.HttpContent
      extended by com.ning.http.client.HttpResponseBodyPart
Direct Known Subclasses:
ApacheResponseBodyPart, ResponseBodyPart, ResponseBodyPart

public abstract class HttpResponseBodyPart
extends HttpContent

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


Field Summary
 
Fields inherited from class com.ning.http.client.HttpContent
provider, uri
 
Constructor Summary
HttpResponseBodyPart(URI uri, AsyncHttpProvider provider)
           
 
Method Summary
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  int writeTo(OutputStream outputStream)
          Write the available bytes to the OutputStream
 
Methods inherited from class com.ning.http.client.HttpContent
getUrl, provider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpResponseBodyPart

public HttpResponseBodyPart(URI uri,
                            AsyncHttpProvider provider)
Method Detail

getBodyPartBytes

public abstract byte[] getBodyPartBytes()
Return the response body's part bytes received.

Returns:
the response body's part bytes received.

writeTo

public abstract int writeTo(OutputStream outputStream)
                     throws IOException
Write the available bytes to the OutputStream

Parameters:
outputStream -
Returns:
The number of bytes written
Throws:
IOException

getBodyByteBuffer

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


Copyright © 2011. All Rights Reserved.