Package com.ning.http.client
Interface RandomAccessBody
- All Superinterfaces:
AutoCloseable,Body,Closeable
- All Known Implementing Classes:
FileBodyGenerator.FileBody,MultipartBody
A request body which supports random access to its contents.
-
Method Summary
Modifier and TypeMethodDescriptionlongtransferTo(long position, WritableByteChannel target) Transfers the specified chunk of bytes from this body to the specified channel.Methods inherited from interface com.ning.http.client.Body
getContentLength, read
-
Method Details
-
transferTo
Transfers the specified chunk of bytes from this body to the specified channel.- Parameters:
position- The zero-based byte index from which to start the transfer, must not be negative.target- The destination channel to transfer the body chunk to, must not benull.- Returns:
- The non-negative number of bytes actually transferred.
- Throws:
IOException- If the body chunk could not be transferred.
-