public class ReliableResourceInputStream extends InputStream
Constructor and Description |
---|
ReliableResourceInputStream(com.google.common.io.FileBackedOutputStream fbos,
com.google.common.io.CountingOutputStream countingFbos,
DownloadManagerState downloadState,
String downloadIdentifier,
ResourceResponse resourceResponse) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
long |
getBytesCached() |
long |
getBytesRead()
Returns the number of bytes read thus far from the @FileBackedOutputStream
|
DownloadManagerState |
getDownloadState() |
boolean |
isClosed() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
setCallableAndItsFuture(ReliableResourceCallable reliableResourceCallable,
Future<ReliableResourceStatus> downloadFuture)
Sets the @Callable and the @Future that started the @Callable that is populating the
|
available, mark, markSupported, read, reset, skip
public ReliableResourceInputStream(com.google.common.io.FileBackedOutputStream fbos, com.google.common.io.CountingOutputStream countingFbos, DownloadManagerState downloadState, String downloadIdentifier, ResourceResponse resourceResponse)
fbos
- the @FileBackedOutputStream this object will read fromcountingFbos
- wrapped @FileBackedOutputStream that counts the number of bytes written so
fardownloadState
- the current state of the resource's downloadpublic void setCallableAndItsFuture(ReliableResourceCallable reliableResourceCallable, Future<ReliableResourceStatus> downloadFuture)
reliableResourceCallable
- cachingFuture
- @FileBackedOutputStream is object is reading from.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public boolean isClosed()
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public long getBytesRead()
public long getBytesCached()
public DownloadManagerState getDownloadState()
This work is licensed under a Creative Commons Attribution 4.0 International License.