Package com.ning.http.client
Interface Body
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Subinterfaces:
RandomAccessBody
- All Known Implementing Classes:
ByteArrayBodyGenerator.ByteBody,FileBodyGenerator.FileBody,InputStreamBodyGenerator.ISBody,MultipartBody
A request body.
-
Method Summary
Modifier and TypeMethodDescriptionlongGets the length of the body.longread(ByteBuffer buffer) Reads the next chunk of bytes from the body.
-
Method Details
-
getContentLength
long getContentLength()Gets the length of the body.- Returns:
- The length of the body in bytes, or negative if unknown.
-
read
Reads the next chunk of bytes from the body.- Parameters:
buffer- The buffer to store the chunk in, must not benull.- Returns:
- The non-negative number of bytes actually read or
-1if the body has been read completely. - Throws:
IOException- If the chunk could not be read.
-