Encoder

interface Encoder

Encoder

Specifies the expected API interface for an encoding tool, which is capable of encoding data to a given format or expression, as well as decoding from that same format.

Inheritors

Functions

Link copied to clipboard
abstract fun decode(data: ByteArray): ByteArray

Decode the provided data, returning the raw resulting bytes.

abstract fun decode(string: String): ByteArray

Decode the provided string, returning the raw resulting bytes.

Link copied to clipboard
abstract fun decodeToString(data: ByteArray): String

Decode the provided data, returning a decoded string.

abstract fun decodeToString(string: String): String

Decode the provided string, returning a decoded string.

Link copied to clipboard
abstract fun encode(data: ByteArray): ByteArray

Encode the provided data, returning the raw resulting bytes.

abstract fun encode(string: String): ByteArray

Encode the provided string, returning the raw resulting bytes.

Link copied to clipboard
abstract fun encodeToString(data: ByteArray): String

Encode the provided data, returning an encoded string.

abstract fun encodeToString(string: String): String

Encode the provided string, returning an encoded string.

Link copied to clipboard
abstract fun encoding(): Encoding

Return the enumerated Encoding which is implemented by this Encoder.