Package com.ning.http.client.generators
Class InputStreamBodyGenerator.ISBody
java.lang.Object
com.ning.http.client.generators.InputStreamBodyGenerator.ISBody
- All Implemented Interfaces:
Body,Closeable,AutoCloseable
- Enclosing class:
- InputStreamBodyGenerator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected intdoRead()longGets the length of the body.longread(ByteBuffer buffer) Reads the next chunk of bytes from the body.
-
Field Details
-
chunk
protected byte[] chunk
-
-
Constructor Details
-
ISBody
protected ISBody()
-
-
Method Details
-
getContentLength
public long getContentLength()Description copied from interface:BodyGets the length of the body.- Specified by:
getContentLengthin interfaceBody- Returns:
- The length of the body in bytes, or negative if unknown.
-
read
Description copied from interface:BodyReads the next chunk of bytes from the body.- Specified by:
readin interfaceBody- 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.
-
doRead
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-