public class ResumableRandomAccessFileListener extends java.lang.Object implements ResumableListener
ResumableListener
which use a RandomAccessFile
for storing the received bytes.Constructor and Description |
---|
ResumableRandomAccessFileListener(java.io.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(java.nio.ByteBuffer buffer)
This method uses the last valid bytes written on disk to position a
RandomAccessFile , allowing
resumable file download. |
public ResumableRandomAccessFileListener(java.io.RandomAccessFile file)
public void onBytesReceived(java.nio.ByteBuffer buffer) throws java.io.IOException
RandomAccessFile
, allowing
resumable file download.onBytesReceived
in interface ResumableListener
buffer
- a ByteBuffer
java.io.IOException
- exception while writing into the filepublic void onAllBytesReceived()
onAllBytesReceived
in interface ResumableListener
public long length()
length
in interface ResumableListener
Copyright © 2018. All Rights Reserved.