com.ning.http.client
Interface RandomAccessBody

All Superinterfaces:
Body
All Known Implementing Classes:
FileBodyGenerator.FileBody, MultipartBody

public interface RandomAccessBody
extends Body

A request body which supports random access to its contents.


Method Summary
 long transferTo(long position, long count, WritableByteChannel target)
          Transfers the specified chunk of bytes from this body to the specified channel.
 
Methods inherited from interface com.ning.http.client.Body
close, getContentLength, read
 

Method Detail

transferTo

long transferTo(long position,
                long count,
                WritableByteChannel target)
                throws IOException
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.
count - The maximum number of bytes to transfer, must not be negative.
target - The destination channel to transfer the body chunk to, must not be null.
Returns:
The non-negative number of bytes actually transferred.
Throws:
IOException - If the body chunk could not be transferred.


Copyright © 2011. All Rights Reserved.