Encoder

Constructors

Link copied to clipboard
constructor(cs: Charset)

Functions

Link copied to clipboard

Returns the average number of bytes that will be produced for each character of input. This heuristic value may be used to estimate the size of the output buffer required for a given input sequence.

Link copied to clipboard

Tells whether or not this encoder can encode the given character sequence.

open override fun canEncode(c: Char): Boolean

Tells whether or not this encoder can encode the given character.

Link copied to clipboard

Returns the charset that created this encoder.

Link copied to clipboard

Convenience method that encodes the remaining content of a single input character buffer into a newly-allocated byte buffer.

fun encode(in: CharBuffer, out: ByteBuffer, endOfInput: Boolean): CoderResult

Encodes as many characters as possible from the given input buffer, writing the results to the given output buffer.

Link copied to clipboard

Flushes this encoder.

Link copied to clipboard

Tells whether or not the given byte array is a legal replacement value for this encoder.

Link copied to clipboard

Returns this encoder's current action for malformed-input errors.

Link copied to clipboard

Returns the maximum number of bytes that will be produced for each character of input. This value may be used to compute the worst-case size of the output buffer required for a given input sequence. This value accounts for any necessary content-independent prefix or suffix

Link copied to clipboard

Changes this encoder's action for malformed-input errors.

Link copied to clipboard

Changes this encoder's action for unmappable-character errors.

Link copied to clipboard

Returns this encoder's replacement value.

Link copied to clipboard
fun replaceWith(newReplacement: ByteArray): CharsetEncoder

Changes this encoder's replacement value.

Link copied to clipboard

Resets this encoder, clearing any internal state.

Link copied to clipboard

Returns this encoder's current action for unmappable-character errors.