public abstract class HttpResponseBodyPart extends Object
Constructor and Description |
---|
HttpResponseBodyPart(boolean last) |
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
isLast()
Return true if this is the last part.
|
boolean |
isUnderlyingConnectionToBeClosed()
Return true of the underlying connection will be closed once the response has been fully processed.
|
abstract int |
length()
Return length of this part in bytes.
|
void |
markUnderlyingConnectionAsToBeClosed()
Close the underlying connection once the processing has completed.
|
abstract InputStream |
readBodyPartBytes()
Method for accessing contents of this part via stream.
|
abstract int |
writeTo(OutputStream outputStream)
Write the available bytes to the
OutputStream |
public void markUnderlyingConnectionAsToBeClosed()
public boolean isUnderlyingConnectionToBeClosed()
public boolean isLast()
public abstract int length()
public abstract byte[] getBodyPartBytes()
public abstract InputStream readBodyPartBytes()
public abstract int writeTo(OutputStream outputStream) throws IOException
OutputStream
outputStream
- IOException
public abstract ByteBuffer getBodyByteBuffer()
ByteBuffer
that wraps the actual bytes read from the response's chunk. The ByteBuffer
capacity is equal to the number of bytes available.ByteBuffer
Copyright © 2014. All Rights Reserved.