Skip to main content

com.eruces.teagent.TECipherOutputStream

The TECipherOutputStream class is a cipher output stream that also carries the TTag of the key its cipher was built from.

Since: 1.0

© Pi Soft, 2018-2026 · Tricryption Engine 8.1

Inheritance

  • Inherits CipherOutputStream

Public Member Functions

MemberDescription
TECipherOutputStream(OutputStream os, Cipher c, byte[] ttag)Constructs a Tricryption encryption output stream.
TECipherOutputStream(OutputStream os, TECipher c)Constructs a Tricryption cipher encryption stream.
void close()Closes output stream.
void flush()Flushes cipher output stream Note: Do not flush until the the end of output stream.
void write(byte[] b)Writes b.length bytes to cipher output stream.
void write(byte[] b, int off, int len)Writes data to cipher output stream.
void write(int b)Writes the specified byte to output stream.

Member Function Documentation

TECipherOutputStream(OutputStream os, Cipher c, byte[] ttag)

Constructs a Tricryption encryption output stream.

Parameters

ParameterDescription
osoutput stream
ca fully initialized cipher object. The cipher object can be constructed with Eruces JCE provider.
ttagT-tag of the secret key used to construct cipher object

TECipherOutputStream(OutputStream os, TECipher c)

Constructs a Tricryption cipher encryption stream.

Parameters

ParameterDescription
osoutput stream
ca Tricryption cipher object

Exceptions

ExceptionDescription
TEAgentExceptionif the request cannot be completed on the connection, or the Key Service returns an error for it (delivered as a TEServerException).

void close()

Closes output stream.

Exceptions

ExceptionDescription
IOExceptionif the underlying stream cannot be written or closed.

void flush()

Flushes cipher output stream Note: Do not flush until the the end of output stream.

Exceptions

ExceptionDescription
IOExceptionif the underlying stream cannot be written or closed.

void write(byte[] b)

Writes b.length bytes to cipher output stream.

Parameters

ParameterDescription
bthe input buffer

Exceptions

ExceptionDescription
IOExceptionif the underlying stream cannot be written or closed.

void write(byte[] b, int off, int len)

Writes data to cipher output stream.

Parameters

ParameterDescription
bthe input buffer
offthe offset in b where the input starts
lenthe input length

Exceptions

ExceptionDescription
IOExceptionif the underlying stream cannot be written or closed.

void write(int b)

Writes the specified byte to output stream.

Parameters

ParameterDescription
bthe byte

Exceptions

ExceptionDescription
IOExceptionif the underlying stream cannot be written or closed.