A charset coder, that is, either a decoder or an encoder, consumes bytes (or characters) from an input buffer, translates them, and writes the resulting characters (or bytes) to an output buffer. A coding process terminates for one of four categories of reasons, which are described by instances of this class:
Underflow is reported when there is no more input to be processed, or there is insufficient input and additional input is required. This condition is represented by the unique result object {@link #UNDERFLOW}, whose {@link #isUnderflow() isUnderflow} methodreturns true.
Overflow is reported when there is insufficient room remaining in the output buffer. This condition is represented by the unique result object {@link #OVERFLOW}, whose {@link #isOverflow() isOverflow} method returns true.
A malformed-input error is reported when a sequence of input units is not well-formed. Such errors are described by instances of this class whose {@link #isMalformed() isMalformed} method returnstrue and whose {@link #length() length} method returns the lengthof the malformed sequence. There is one unique instance of this class for all malformed-input errors of a given length.
An unmappable-character error is reported when a sequence of input units denotes a character that cannot be represented in the output charset. Such errors are described by instances of this class whose {@link #isUnmappable() isUnmappable} method returns true andwhose {@link #length() length} method returns the length of the inputsequence denoting the unmappable character. There is one unique instance of this class for all unmappable-character errors of a given length.
For convenience, the {@link #isError() isError} method returns truefor result objects that describe malformed-input and unmappable-character errors but false for those that describe underflow or overflow conditions.
@author Mark Reinhold @author JSR-51 Expert Group @since 1.4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|