Package org.asynchttpclient.request.body
Interface Body
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Subinterfaces:
RandomAccessBody
- All Known Implementing Classes:
ByteArrayBodyGenerator.ByteBody
,MultipartBody
,PushBody
public interface Body extends Closeable
A request body.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Body.BodyState
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getContentLength()
Gets the length of the body.Body.BodyState
transferTo(io.netty.buffer.ByteBuf target)
Reads the next chunk of bytes from the body.
-
-
-
Method Detail
-
getContentLength
long getContentLength()
Gets the length of the body.- Returns:
- The length of the body in bytes, or negative if unknown.
-
transferTo
Body.BodyState transferTo(io.netty.buffer.ByteBuf target) throws IOException
Reads the next chunk of bytes from the body.- Parameters:
target
- The buffer to store the chunk in, must not benull
.- Returns:
- The state.
- Throws:
IOException
- If the chunk could not be read.
-
-