com.ning.http.client.providers.netty
Class ResponseBodyPart
java.lang.Object
com.ning.http.client.HttpContent
com.ning.http.client.HttpResponseBodyPart
com.ning.http.client.providers.netty.ResponseBodyPart
public class ResponseBodyPart
- extends HttpResponseBodyPart
A callback class used when an HTTP response body is received.
Method Summary |
protected org.jboss.netty.handler.codec.http.HttpChunk |
chunk()
|
java.nio.ByteBuffer |
getBodyByteBuffer()
Return a ByteBuffer that wraps the actual bytes read from the response's chunk. |
byte[] |
getBodyPartBytes()
Return the response body's part bytes received. |
int |
writeTo(java.io.OutputStream outputStream)
Write the available bytes to the OutputStream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResponseBodyPart
public ResponseBodyPart(java.net.URI uri,
org.jboss.netty.handler.codec.http.HttpResponse response,
AsyncHttpProvider provider)
ResponseBodyPart
public ResponseBodyPart(java.net.URI uri,
org.jboss.netty.handler.codec.http.HttpResponse response,
AsyncHttpProvider provider,
org.jboss.netty.handler.codec.http.HttpChunk chunk)
getBodyPartBytes
public byte[] getBodyPartBytes()
- Return the response body's part bytes received.
- Specified by:
getBodyPartBytes
in class HttpResponseBodyPart
- Returns:
- the response body's part bytes received.
writeTo
public int writeTo(java.io.OutputStream outputStream)
throws java.io.IOException
- Description copied from class:
HttpResponseBodyPart
- Write the available bytes to the
OutputStream
- Specified by:
writeTo
in class HttpResponseBodyPart
- Returns:
- The number of bytes written
- Throws:
java.io.IOException
getBodyByteBuffer
public java.nio.ByteBuffer getBodyByteBuffer()
- Description copied from class:
HttpResponseBodyPart
- 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.
- Specified by:
getBodyByteBuffer
in class HttpResponseBodyPart
- Returns:
ByteBuffer
chunk
protected org.jboss.netty.handler.codec.http.HttpChunk chunk()
Copyright © 2012. All Rights Reserved.