PrivMX DOCS
API Reference/PrivMX Endpoint Java Extra/Inbox

InboxFileStreamReader

Manages handle for file reading from Inbox.

Static Methods

openFile

Opens Inbox file.

Params

api

InboxApi

reference to Inbox API

fileId

String

ID of the file to open

public static InboxFileStreamReader openFile(
InboxApi api,
String fileId
)

Returns

InboxFileStreamReader · Instance ready to read from the Inbox file

openFile

Opens Inbox file and writes it into OutputStream with optimized chunk size InboxFileStream#OPTIMAL_SEND_SIZE.

Params

api

InboxApi

reference to Inbox API

fileId

String

ID of the file to open

outputStream

OutputStream

stream to write downloaded data

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

Returns

String · ID of the read file

openFile

Opens Inbox file and writes it into OutputStream with optimized chunk size InboxFileStream#OPTIMAL_SEND_SIZE.

Params

api

InboxApi

reference to Inbox API

fileId

String

ID of the file to open

outputStream

OutputStream

stream to write downloaded data

streamController

Controller

controls the process of reading file

public static String openFile(
InboxApi 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 InboxFileStream#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.