Skip to main content
reference

StoreFileStream

Base class for Store file streams. Implements progress listeners.

Constructors

StoreFileStream

Creates instance of `StoreFileStream`.

protected void StoreFileStream(
Long handle,
StoreApi storeApi
)

NameTypeDescription
handleLonghandle to Store file
storeApiStoreApiStoreApi 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
)

NameTypeDescription
chunkSizeLongsize of processed chunk

close

Closes file handle.

public String close()

TypeDescription
String ID of the closed file

isClosed

Returns information whether the instance is closed.

public Boolean isClosed()

TypeDescription
Boolean `true` if file handle is closed

setProgressListener

Sets listening for single chunk sent/read.

public void setProgressListener(
ProgressListener progressListener
)

NameTypeDescription
progressListenerProgressListenercallback triggered when chunk is sent/read