PrivMX DOCS
API Reference/PrivMX Endpoint Java Extra/Inbox

InboxFileStreamWriter

Manages handle for file writing.

Static Methods

createFile

Creates a new file in given Inbox.

Params

api

InboxApi

reference to Inbox API

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

public static InboxFileStreamWriter createFile(
InboxApi api,
byte[] publicMeta,
byte[] privateMeta,
long size
)

Returns

InboxFileStreamWriter · Instance ready to write to the created Inbox file

Methods

write

Writes data to Inbox file.

Params

inboxHandle

long

the handle of the Inbox to write to

data

byte[]

data to write (the recommended size of data chunk is InboxFileStream#OPTIMAL_SEND_SIZE)

public void write(
long inboxHandle,
byte[] data
)

writeStream

Writes data from an InputStream to an Inbox file.

Params

inboxHandle

long

the handle of an Inbox to write to

inputStream

InputStream

the InputStream to read data from

public void writeStream(
long inboxHandle,
InputStream inputStream
)

writeStream

Writes data from an InputStream to an Inbox file.

Params

inboxHandle

long

the handle of the Inbox to write to

inputStream

InputStream

the InputStream to read data from

streamController

Controller

an optional controller for monitoring and controlling the write operation.

public void writeStream(
long inboxHandle,
InputStream inputStream,
Controller streamController
)

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.