StoreFileStream
Base class for Store file streams. Implements progress listeners.
Constructors
StoreFileStream
Creates instance of `StoreFileStream`.
protected void StoreFileStream(
Long handle,
StoreApi storeApi
)
Name | Type | Description |
---|---|---|
handle | Long | handle to Store file |
storeApi | StoreApi | StoreApi instance that calls read/write methods on files |
Fields
OPTIMAL_SEND_SIZE
Constant value with optimal size of reading/sending data.
public static final long OPTIMAL_SEND_SIZE= 131072
handle
Reference to file handle.
protected final Long handle
storeApi
Reference to StoreApi.
protected final StoreApi storeApi
Methods
callChunkProcessed
Increases the size of current sent/read data by chunkSize and calls ProgressListener#onChunkProcessed(Long).
protected void callChunkProcessed(
Long chunkSize
)
Name | Type | Description |
---|---|---|
chunkSize | Long | size of processed chunk |
close
Closes file handle.
public String close()
Type | Description |
---|---|
String | ID of the closed file |
isClosed
Returns information whether the instance is closed.
public Boolean isClosed()
Type | Description |
---|---|
Boolean | `true` if file handle is closed |
setProgressListener
Sets listening for single chunk sent/read.
public void setProgressListener(
ProgressListener progressListener
)
Name | Type | Description |
---|---|---|
progressListener | ProgressListener | callback triggered when chunk is sent/read |