PrivMX DOCS
API Reference/PrivMX Endpoint Java Extra/Store

StoreFileStreamReader

Manages handle for file reading.

Static Methods

openFile

Opens Store file.

Params

api

StoreApi

reference to Store API

fileId

String

ID of the file to open

public static StoreFileStreamReader openFile(
StoreApi api,
String fileId
)

Returns

StoreFileStreamReader · Instance ready to read from the Store file

openFile

Opens Store file and writes it into OutputStream.

Params

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

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

Returns

String · ID of the read file

openFile

Opens Store file and writes it into OutputStream.

Params

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

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

Returns

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.

Params

size

Long

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

public byte[] read(
Long size
)

Returns

byte[] · Read data

seek

Moves read cursor.

Params

position

long

new cursor position

public void seek(
long position
)

We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.