Skip to main content
reference

StoreFileStreamReader

Manages handle for file reading.

Static Methods

openFile

Opens Store file.

public static StoreFileStreamReader openFile(
StoreApi api,
String fileId
)

NameTypeDescription
apiStoreApireference to Store API
fileIdStringID of the file to open

TypeDescription
StoreFileStreamReader Instance ready to read from the Store file

openFile

Opens Store file and writes it into OutputStream.

public static String openFile(
StoreApi api,
String fileId,
OutputStream outputStream
)

NameTypeDescription
apiStoreApireference to Store API
fileIdStringID of the file to open
outputStreamOutputStreamstream to write downloaded data with optimized chunk size StoreFileStream#OPTIMAL_SEND_SIZE

TypeDescription
String ID of the read file

openFile

Opens Store file and writes it into OutputStream.

public static String openFile(
StoreApi api,
String fileId,
OutputStream outputStream,
Controller streamController
)

NameTypeDescription
apiStoreApireference to Store API
fileIdStringID of the file to open
outputStreamOutputStreamstream to write downloaded data with optimized chunk size StoreFileStream#OPTIMAL_SEND_SIZE
streamControllerControllercontrols the process of reading file

TypeDescription
String ID of the read file

Methods

read

Reads file data and moves the cursor. If read data size is less than length, then EOF.

public byte[] read(
Long size
)

NameTypeDescription
sizeLongsize of data to read (the recommended size is StoreFileStream#OPTIMAL_SEND_SIZE)

TypeDescription
byte[] Read data

seek

Moves read cursor.

public void seek(
long position
)

NameTypeDescription
positionlongnew cursor position