public class FileBodyConsumer extends Object implements ResumableBodyConsumer
RandomAccessFile that can be used as a ResumableBodyConsumer| Constructor and Description |
|---|
FileBodyConsumer(RandomAccessFile file) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
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
consume in interface BodyConsumerbyteBuffer - a ByteBuffer representation of the response's chunk.IOException - IO exceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic long getTransferredBytes()
throws IOException
getTransferredBytes in interface ResumableBodyConsumerIOException - IO exceptionpublic void resume()
throws IOException
resume in interface ResumableBodyConsumerIOException - IO exceptionCopyright © 2021. All rights reserved.