PrivMX DOCS
API Reference/PrivMX Endpoint Java Extra/Inbox

InboxFileStream

Base class for Inbox file streams.

Constructors

InboxFileStream

Creates instance of InboxFileStream.

Params

handle

Long

handle to Inbox file

inboxApi

InboxApi

InboxApi instance that calls read/write methods on files

protected void InboxFileStream(
Long handle,
InboxApi inboxApi
)

Fields

OPTIMAL_SEND_SIZE

long Constant value with optimal size of reading/sending data.

handle

Long Reference to file handle.

inboxApi

InboxApi Reference to InboxApi instance.

Methods

callChunkProcessed

Increases the size of current sent/read data by chunkSize and calls ProgressListener#onChunkProcessed(Long).

Params

chunkSize

Long

size of processed chunk

protected void callChunkProcessed(
Long chunkSize
)

close

Closes file handle.

public synchronized String close()

Returns

String · ID of the closed file

getFileHandle

Gets current file handle.

public Long getFileHandle()

Returns

Long · file handle.

getProcessedBytes

Gets size of sent data.

public Long getProcessedBytes()

Returns

Long · size of sent data.

isClosed

Returns information whether the instance is closed.

public Boolean isClosed()

Returns

Boolean · true if file handle is closed

setProgressListener

Sets listening for single chunk sent/read.

Params

progressListener

ProgressListener

callback triggered when chunk is sent/read

public void setProgressListener(
ProgressListener progressListener
)

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.