public class ResumableRandomAccessFileListener extends Object implements ResumableListener
ResumableListener
which use a RandomAccessFile
for storing the received bytes.Constructor and Description |
---|
ResumableRandomAccessFileListener(RandomAccessFile file) |
Modifier and Type | Method and Description |
---|---|
long |
length()
Return the length of previously downloaded bytes.
|
void |
onAllBytesReceived()
Invoked when all the bytes has been sucessfully transferred.
|
void |
onBytesReceived(ByteBuffer buffer)
This method uses the last valid bytes written on disk to position a
RandomAccessFile , allowing
resumable file download. |
public ResumableRandomAccessFileListener(RandomAccessFile file)
public void onBytesReceived(ByteBuffer buffer) throws IOException
RandomAccessFile
, allowing
resumable file download.onBytesReceived
in interface ResumableListener
buffer
- a ByteBuffer
IOException
- exception while writing into the filepublic void onAllBytesReceived()
onAllBytesReceived
in interface ResumableListener
public long length()
length
in interface ResumableListener
Copyright © 2016. All Rights Reserved.