public class FileBodyConsumer extends Object implements ResumableBodyConsumer
Constructor and Description |
---|
FileBodyConsumer(RandomAccessFile file) |
Modifier and Type | Method and Description |
---|---|
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.
|
public FileBodyConsumer(RandomAccessFile file)
public void consume(ByteBuffer byteBuffer) throws IOException
BodyConsumer
consume
in interface BodyConsumer
byteBuffer
- a ByteBuffer
represntation of the response's chunk.IOException
public void close() throws IOException
BodyConsumer
close
in interface BodyConsumer
IOException
public long getTransferredBytes() throws IOException
ResumableBodyConsumer
getTransferredBytes
in interface ResumableBodyConsumer
IOException
public void resume() throws IOException
ResumableBodyConsumer
resume
in interface ResumableBodyConsumer
IOException
Copyright © 2015. All rights reserved.