Package org.asynchttpclient.netty
Class EagerResponseBodyPart
- java.lang.Object
-
- org.asynchttpclient.HttpResponseBodyPart
-
- org.asynchttpclient.netty.EagerResponseBodyPart
-
public class EagerResponseBodyPart extends HttpResponseBodyPart
A callback class used when an HTTP response body is received. Bytes are eagerly fetched from the ByteBuf
-
-
Constructor Summary
Constructors Constructor Description EagerResponseBodyPart(io.netty.buffer.ByteBuf buf, boolean last)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBuffer
getBodyByteBuffer()
byte[]
getBodyPartBytes()
Return the response body's part bytes received.int
length()
-
Methods inherited from class org.asynchttpclient.HttpResponseBodyPart
isLast
-
-
-
-
Method Detail
-
getBodyPartBytes
public byte[] getBodyPartBytes()
Return the response body's part bytes received.- Specified by:
getBodyPartBytes
in classHttpResponseBodyPart
- Returns:
- the response body's part bytes received.
-
length
public int length()
- Specified by:
length
in classHttpResponseBodyPart
- Returns:
- length of this part in bytes
-
getBodyByteBuffer
public ByteBuffer getBodyByteBuffer()
- Specified by:
getBodyByteBuffer
in classHttpResponseBodyPart
- Returns:
- a
ByteBuffer
that wraps the actual bytes read from the response's chunk. TheByteBuffer
's capacity is equal to the number of bytes available.
-
-