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
)
Name | Type | Description |
---|---|---|
api | StoreApi | reference to Store API |
storeId | String | ID of the Store |
publicMeta | byte[] | byte array of any arbitrary metadata that can be read by anyone |
privateMeta | byte[] | byte array of any arbitrary metadata that will be encrypted before sending |
size | long | size of data to write |
Type | Description |
---|---|
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
)
Name | Type | Description |
---|---|---|
api | StoreApi | reference to Store API |
storeId | String | ID of the Store |
publicMeta | byte[] | byte array of any arbitrary metadata that can be read by anyone |
privateMeta | byte[] | byte array of any arbitrary metadata that will be encrypted before sending |
size | long | size of data to write |
inputStream | InputStream | stream with data to write to the file using optimal chunk size StoreFileStream#OPTIMAL_SEND_SIZE |
Type | Description |
---|---|
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
)
Name | Type | Description |
---|---|---|
api | StoreApi | reference to Store API |
storeId | String | ID of the Store |
publicMeta | byte[] | byte array of any arbitrary metadata that can be read by anyone |
privateMeta | byte[] | byte array of any arbitrary metadata that will be encrypted before sending |
size | long | size of data to write |
inputStream | InputStream | stream with data to write to the file using optimal chunk size StoreFileStream#OPTIMAL_SEND_SIZE |
streamController | Controller | controls the process of writing file |
Type | Description |
---|---|
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
)
Name | Type | Description |
---|---|---|
api | StoreApi | reference to Store API |
fileId | String | ID of the file to update |
publicMeta | byte[] | new public metadata for the matching file |
privateMeta | byte[] | new private (encrypted) metadata for the matching file |
size | long | size of data to write |
Type | Description |
---|---|
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
)
Name | Type | Description |
---|---|---|
api | StoreApi | reference to Store API |
fileId | String | ID of the file to update |
publicMeta | byte[] | new public metadata for the matching file |
privateMeta | byte[] | new private (encrypted) metadata for the matching file |
size | long | size of data to write |
inputStream | InputStream | stream with data to write to the file using optimal chunk size StoreFileStream#OPTIMAL_SEND_SIZE |
Type | Description |
---|---|
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
)
Name | Type | Description |
---|---|---|
api | StoreApi | reference to Store API |
fileId | String | ID of the file to update |
publicMeta | byte[] | new public metadata for the matching file |
privateMeta | byte[] | new private (encrypted) metadata for the matching file |
size | long | size of data to write |
inputStream | InputStream | stream with data to write to the file using optimal chunk size StoreFileStream#OPTIMAL_SEND_SIZE |
streamController | Controller | controls the process of writing file |
Type | Description |
---|---|
String | Updated file ID |
Methods
write
Writes data to Store file.
public void write(
byte[] data
)
Name | Type | Description |
---|---|---|
data | byte[] | data to write (the recommended size of data chunk is StoreFileStream#OPTIMAL_SEND_SIZE) |