StoreFileStreamReader
Manages handle for file reading.
Static Methods
openFile
Opens Store file.
public static StoreFileStreamReader openFile(
StoreApi api,
String fileId
)
Name | Type | Description |
---|---|---|
api | StoreApi | reference to Store API |
fileId | String | ID of the file to open |
Type | Description |
---|---|
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
)
Name | Type | Description |
---|---|---|
api | StoreApi | reference to Store API |
fileId | String | ID of the file to open |
outputStream | OutputStream | stream to write downloaded data with optimized chunk size StoreFileStream#OPTIMAL_SEND_SIZE |
Type | Description |
---|---|
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
)
Name | Type | Description |
---|---|---|
api | StoreApi | reference to Store API |
fileId | String | ID of the file to open |
outputStream | OutputStream | stream to write downloaded data with optimized chunk size StoreFileStream#OPTIMAL_SEND_SIZE |
streamController | Controller | controls the process of reading file |
Type | Description |
---|---|
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
)
Name | Type | Description |
---|---|---|
size | Long | size of data to read (the recommended size is StoreFileStream#OPTIMAL_SEND_SIZE) |
Type | Description |
---|---|
byte[] | Read data |
seek
Moves read cursor.
public void seek(
long position
)
Name | Type | Description |
---|---|---|
position | long | new cursor position |