Encoder

Encoder

Inheritors

Functions

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

Encoded the provided data using the encoding implemented by this encoder; the returned Raw instance is able to provide a resulting ByteArray or String.

Link copied to clipboard

Encode the provided data using the encoding implemented by this encoder; return a ByteArray representation of the result.

Link copied to clipboard
open fun encodeString(string: String): ByteArray

Encode the provided string data using the encoding implemented by this encoder; by default, the string will be interpreted using UTF-8 encoding, then encoded to the target encoding.

Link copied to clipboard

Encode the provided data to a string representation using the encoding implemented by this encoder.

open fun encodeToString(string: String): String

Encode the provided string to a string representation using the encoding implemented by this encoder; the string is interpreted using UTF-8 encoding.

Link copied to clipboard
abstract fun encoding(): Encoding

Return the enumerated Encoding which is implemented by this Codec.