public class

FileBodyConsumer

extends Object
implements ResumableBodyConsumer
java.lang.Object
   ↳ com.ning.http.client.consumers.FileBodyConsumer

Class Overview

A RandomAccessFile that can be used as a ResumableBodyConsumer

Summary

Public Constructors
FileBodyConsumer(RandomAccessFile file)
Public Methods
void close()
Invoked when all the response bytes has been processed.
void consume(ByteBuffer byteBuffer)
Consume the received bytes.
long getTransferredBytes()
Get the previously transferred bytes, for example the current file size.
void resume()
Prepare this consumer to resume a download, for example by seeking to the end of the underlying file.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.ning.http.client.BodyConsumer
From interface com.ning.http.client.ResumableBodyConsumer

Public Constructors

public FileBodyConsumer (RandomAccessFile file)

Public Methods

public void close ()

Invoked when all the response bytes has been processed.

Throws
IOException

public void consume (ByteBuffer byteBuffer)

Consume the received bytes.

Parameters
byteBuffer a ByteBuffer represntation of the response's chunk.
Throws
IOException

public long getTransferredBytes ()

Get the previously transferred bytes, for example the current file size.

Throws
IOException

public void resume ()

Prepare this consumer to resume a download, for example by seeking to the end of the underlying file.

Throws
IOException