public class GrizzlyResponseBodyPart extends HttpResponseBodyPart
HttpResponseBodyPart implementation using the Grizzly 2.0 HTTP client
codec.| Constructor and Description |
|---|
GrizzlyResponseBodyPart(org.glassfish.grizzly.http.HttpContent content,
org.glassfish.grizzly.Connection connection) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
int |
length()
Return length of this part in bytes.
|
void |
markUnderlyingConnectionAsToBeClosed()
Close the underlying connection once the processing has completed.
|
int |
writeTo(OutputStream outputStream)
Write the available bytes to the
OutputStream |
public GrizzlyResponseBodyPart(org.glassfish.grizzly.http.HttpContent content,
org.glassfish.grizzly.Connection connection)
public byte[] getBodyPartBytes()
HttpResponseBodyPartgetBodyPartBytes in class HttpResponseBodyPartpublic int writeTo(OutputStream outputStream) throws IOException
HttpResponseBodyPartOutputStreamwriteTo in class HttpResponseBodyPartIOExceptionpublic ByteBuffer getBodyByteBuffer()
HttpResponseBodyPartByteBuffer that wraps the actual bytes read from the response's chunk. The ByteBuffer
capacity is equal to the number of bytes available.getBodyByteBuffer in class HttpResponseBodyPartByteBufferpublic boolean isLast()
HttpResponseBodyPartisLast in class HttpResponseBodyPartpublic void markUnderlyingConnectionAsToBeClosed()
HttpResponseBodyPartmarkUnderlyingConnectionAsToBeClosed in class HttpResponseBodyPartpublic boolean isUnderlyingConnectionToBeClosed()
HttpResponseBodyPartisUnderlyingConnectionToBeClosed in class HttpResponseBodyPartpublic int length()
HttpResponseBodyPartlength in class HttpResponseBodyPartCopyright © 2019. All Rights Reserved.