public class

ResumableRandomAccessFileListener

extends Object
implements ResumableListener
java.lang.Object
   ↳ com.ning.http.client.extra.ResumableRandomAccessFileListener

Class Overview

A TransferListener which use a RandomAccessFile for storing the received bytes.

Summary

Public Constructors
ResumableRandomAccessFileListener(RandomAccessFile file)
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.ning.http.client.resumable.ResumableListener

Public Constructors

public ResumableRandomAccessFileListener (RandomAccessFile file)

Public Methods

public long length ()

Return the length of previously downloaded bytes.

Returns
  • the length of previously downloaded bytes

public void onAllBytesReceived ()

Invoked when all the bytes has been sucessfully transferred.

public void onBytesReceived (ByteBuffer buffer)

This method uses the last valid bytes written on disk to position a RandomAccessFile, allowing resumable file download.

Parameters
buffer a ByteBuffer
Throws
IOException