Package org.asynchttpclient
Class HttpResponseBodyPart
- java.lang.Object
-
- org.asynchttpclient.HttpResponseBodyPart
-
- Direct Known Subclasses:
EagerResponseBodyPart
,LazyResponseBodyPart
public abstract class HttpResponseBodyPart extends Object
A callback class used when an HTTP response body is received.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HttpResponseBodyPart(boolean last)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ByteBuffer
getBodyByteBuffer()
abstract byte[]
getBodyPartBytes()
boolean
isLast()
abstract int
length()
-
-
-
Method Detail
-
length
public abstract int length()
- Returns:
- length of this part in bytes
-
getBodyPartBytes
public abstract byte[] getBodyPartBytes()
- Returns:
- the response body's part bytes received.
-
getBodyByteBuffer
public abstract ByteBuffer getBodyByteBuffer()
- 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.
-
isLast
public boolean isLast()
- Returns:
- true if this is the last part.
-
-