canEncode

open fun canEncode(c: Char): Boolean

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

This method returns false if the given character is a surrogate character; such characters can be interpreted only when they are members of a pair consisting of a high surrogate followed by a low surrogate. The .canEncode method may be used to test whether or not a character sequence can be encoded.

This method may modify this encoder's state; it should therefore not be invoked if an #steps is already in progress.

The default implementation of this method is not very efficient; it should generally be overridden to improve performance.

Return

true if, and only if, this encoder can encode the given character

Parameters

c

The given character

Throws

If an encoding operation is already in progress


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

If this method returns false for a particular character sequence then more information about why the sequence cannot be encoded may be obtained by performing a full #steps.

This method may modify this encoder's state; it should therefore not be invoked if an encoding operation is already in progress.

The default implementation of this method is not very efficient; it should generally be overridden to improve performance.

Return

true if, and only if, this encoder can encode the given character without throwing any exceptions and without performing any replacements

Parameters

cs

The given character sequence

Throws

If an encoding operation is already in progress