Skip to main content
reference

StoreFileStreamWriter

Manages handle for file writing.

Static Methods

createFile

Creates a new file in given Store.

public static StoreFileStreamWriter createFile(
StoreApi api,
String storeId,
byte[] publicMeta,
byte[] privateMeta,
long size
)

NameTypeDescription
apiStoreApireference to Store API
storeIdStringID of the Store
publicMetabyte[]byte array of any arbitrary metadata that can be read by anyone
privateMetabyte[]byte array of any arbitrary metadata that will be encrypted before sending
sizelongsize of data to write

TypeDescription
StoreFileStreamWriter Instance ready to write to the created Store file

createFile

Creates a new file in given Store and writes data from given InputStream.

public static String createFile(
StoreApi api,
String storeId,
byte[] publicMeta,
byte[] privateMeta,
long size,
InputStream inputStream
)

NameTypeDescription
apiStoreApireference to Store API
storeIdStringID of the Store
publicMetabyte[]byte array of any arbitrary metadata that can be read by anyone
privateMetabyte[]byte array of any arbitrary metadata that will be encrypted before sending
sizelongsize of data to write
inputStreamInputStreamstream with data to write to the file using optimal chunk size StoreFileStream#OPTIMAL_SEND_SIZE

TypeDescription
String ID of the created file

createFile

Creates new file in given Store and writes data from given InputStream.

public static String createFile(
StoreApi api,
String storeId,
byte[] publicMeta,
byte[] privateMeta,
long size,
InputStream inputStream,
Controller streamController
)

NameTypeDescription
apiStoreApireference to Store API
storeIdStringID of the Store
publicMetabyte[]byte array of any arbitrary metadata that can be read by anyone
privateMetabyte[]byte array of any arbitrary metadata that will be encrypted before sending
sizelongsize of data to write
inputStreamInputStreamstream with data to write to the file using optimal chunk size StoreFileStream#OPTIMAL_SEND_SIZE
streamControllerControllercontrols the process of writing file

TypeDescription
String ID of the created file

updateFile

Updates an existing file.

public static StoreFileStreamWriter updateFile(
StoreApi api,
String fileId,
byte[] publicMeta,
byte[] privateMeta,
long size
)

NameTypeDescription
apiStoreApireference to Store API
fileIdStringID of the file to update
publicMetabyte[]new public metadata for the matching file
privateMetabyte[]new private (encrypted) metadata for the matching file
sizelongsize of data to write

TypeDescription
StoreFileStreamWriter StoreFileStreamWriter instance prepared for writing

updateFile

Updates existing file and writes data from passed InputStream.

public static String updateFile(
StoreApi api,
String fileId,
byte[] publicMeta,
byte[] privateMeta,
long size,
InputStream inputStream
)

NameTypeDescription
apiStoreApireference to Store API
fileIdStringID of the file to update
publicMetabyte[]new public metadata for the matching file
privateMetabyte[]new private (encrypted) metadata for the matching file
sizelongsize of data to write
inputStreamInputStreamstream with data to write to the file using optimal chunk size StoreFileStream#OPTIMAL_SEND_SIZE

TypeDescription
String Updated file ID

updateFile

Updates existing file and writes data from passed InputStream.

public static String updateFile(
StoreApi api,
String fileId,
byte[] publicMeta,
byte[] privateMeta,
long size,
InputStream inputStream,
Controller streamController
)

NameTypeDescription
apiStoreApireference to Store API
fileIdStringID of the file to update
publicMetabyte[]new public metadata for the matching file
privateMetabyte[]new private (encrypted) metadata for the matching file
sizelongsize of data to write
inputStreamInputStreamstream with data to write to the file using optimal chunk size StoreFileStream#OPTIMAL_SEND_SIZE
streamControllerControllercontrols the process of writing file

TypeDescription
String Updated file ID

Methods

write

Writes data to Store file.

public void write(
byte[] data
)

NameTypeDescription
databyte[]data to write (the recommended size of data chunk is StoreFileStream#OPTIMAL_SEND_SIZE)