com.ning.http.client.consumers
public class FileBodyConsumer extends java.lang.Object implements ResumableBodyConsumer
Constructor and Description |
---|
FileBodyConsumer(java.io.RandomAccessFile file) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Invoked when all the response bytes has been processed.
|
void |
consume(java.nio.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 void consume(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
BodyConsumer
consume
in interface BodyConsumer
byteBuffer
- a ByteBuffer
represntation of the response's chunk.java.io.IOException
public void close() throws java.io.IOException
BodyConsumer
close
in interface BodyConsumer
java.io.IOException
public long getTransferredBytes() throws java.io.IOException
ResumableBodyConsumer
getTransferredBytes
in interface ResumableBodyConsumer
java.io.IOException
public void resume() throws java.io.IOException
ResumableBodyConsumer
resume
in interface ResumableBodyConsumer
java.io.IOException
Copyright © 2014. All Rights Reserved.