CoderResult

public class CoderResult extends Object

Used to indicate the result of encoding/decoding. There are four types of results:

  1. UNDERFLOW indicates that all input has been processed but more input is required. It is represented by the unique object CoderResult.UNDERFLOW.
  2. OVERFLOW indicates an insufficient output buffer size. It is represented by the unique object CoderResult.OVERFLOW.
  3. A malformed-input error indicates that an unrecognizable sequence of input units has been encountered. Get an instance of this type of result by calling CoderResult.malformedForLength(int) with the length of the malformed-input.
  4. An unmappable-character error indicates that a sequence of input units can not be mapped to the output charset. Get an instance of this type of result by calling CoderResult.unmappableForLength(int) with the input sequence size indicating the identity of the unmappable character.

Field Summary

public static final CoderResult OVERFLOW Result object used to indicate that the output buffer does not have enough space available to store the result of the encoding/decoding.
public static final CoderResult UNDERFLOW Result object indicating that there is insufficient data in the encoding/decoding buffer or that additional data is required.

Public Method Summary

boolean
isError()
Returns true if this result represents a malformed-input error or an unmappable-character error.
boolean
isMalformed()
Returns true if this result represents a malformed-input error.
boolean
isOverflow()
Returns true if this result is an overflow condition.
boolean
isUnderflow()
Returns true if this result is an underflow condition.
boolean
isUnmappable()
Returns true if this result represents an unmappable-character error.
int
length()
Gets the length of the erroneous input.
synchronized static CoderResult
malformedForLength(int length)
Gets a CoderResult object indicating a malformed-input error.
void