public interface ICharacterDecoder
| Modifier and Type | Method and Description |
|---|---|
int |
ReadChar(IByteReader input)
Reads bytes from an input transform until a Unicode code point is decoded or
until the end of the stream is reached.
|
int ReadChar(IByteReader input)
If this method returns -2, indicating an error, the caller of this method can take one of a variety of actions to handle the error. For example, it can output one or more replacement code points instead (such as the Replacement Character 0xfffd), or it can throw an exception. In some cases, where the error won't cause data loss or a security problem, the caller can also ignore the decoder error.
input - Source of bytes to decode into code points. The decoder can
maintain internal state, including data on bytes already read, so
this parameter should not change when using the same character
decoder object. It's also possible for the decoder to read no bytes
but still return a code point, depending on the encoding it supports
and its internal state.Encoding for Java documentation, generated in 2017.