canEncode

open override 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