Package com.ning.http.client.extra
Class ResumableRandomAccessFileListener
java.lang.Object
com.ning.http.client.extra.ResumableRandomAccessFileListener
- All Implemented Interfaces:
ResumableListener
A
TransferListener which use a RandomAccessFile for storing the received bytes.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglength()Return the length of previously downloaded bytes.voidInvoked when all the bytes has been sucessfully transferred.voidonBytesReceived(ByteBuffer buffer) This method uses the last valid bytes written on disk to position aRandomAccessFile, allowing resumable file download.
-
Constructor Details
-
ResumableRandomAccessFileListener
-
-
Method Details
-
onBytesReceived
This method uses the last valid bytes written on disk to position aRandomAccessFile, allowing resumable file download.- Specified by:
onBytesReceivedin interfaceResumableListener- Parameters:
buffer- aByteBuffer- Throws:
IOException
-
onAllBytesReceived
public void onAllBytesReceived()Description copied from interface:ResumableListenerInvoked when all the bytes has been sucessfully transferred.- Specified by:
onAllBytesReceivedin interfaceResumableListener
-
length
public long length()Description copied from interface:ResumableListenerReturn the length of previously downloaded bytes.- Specified by:
lengthin interfaceResumableListener- Returns:
- the length of previously downloaded bytes
-