Class ByteArrayBodyGenerator.ByteBody
- java.lang.Object
-
- org.asynchttpclient.request.body.generator.ByteArrayBodyGenerator.ByteBody
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Body
- Enclosing class:
- ByteArrayBodyGenerator
protected final class ByteArrayBodyGenerator.ByteBody extends Object implements Body
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.asynchttpclient.request.body.Body
Body.BodyState
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ByteBody()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
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
public long getContentLength()
Description copied from interface:Body
Gets the length of the body.- Specified by:
getContentLength
in interfaceBody
- Returns:
- The length of the body in bytes, or negative if unknown.
-
transferTo
public Body.BodyState transferTo(io.netty.buffer.ByteBuf target)
Description copied from interface:Body
Reads the next chunk of bytes from the body.- Specified by:
transferTo
in interfaceBody
- Parameters:
target
- The buffer to store the chunk in, must not benull
.- Returns:
- The state.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-