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 io.netty.buffer.ByteBufgetBodyByteBuf()ByteBuffergetBodyByteBuffer()byte[]getBodyPartBytes()Return the response body's part bytes received.intlength()-
Methods inherited from class org.asynchttpclient.HttpResponseBodyPart
isLast
-
-
-
-
Method Detail
-
getBodyPartBytes
public byte[] getBodyPartBytes()
Return the response body's part bytes received.- Specified by:
getBodyPartBytesin classHttpResponseBodyPart- Returns:
- the response body's part bytes received.
-
length
public int length()
- Specified by:
lengthin classHttpResponseBodyPart- Returns:
- length of this part in bytes
-
getBodyByteBuffer
public ByteBuffer getBodyByteBuffer()
- Specified by:
getBodyByteBufferin classHttpResponseBodyPart- Returns:
- a
ByteBufferthat wraps the actual bytes read from the response's chunk. TheByteBuffer's capacity is equal to the number of bytes available.
-
getBodyByteBuf
public io.netty.buffer.ByteBuf getBodyByteBuf()
- Specified by:
getBodyByteBufin classHttpResponseBodyPart- Returns:
- the
ByteBufof the bytes read from the response's chunk. TheByteBuf's capacity is equal to the number of bytes available.
-
-