| |
|
| java.lang.Object java.nio.charset.CoderResult
CoderResult | public class CoderResult (Code) | | Used to indicate the result of encoding/decoding. There are four types of
results:
- UNDERFLOW indicates all input has been processed, or more input is
required. It is represented by the unique object
CoderResult.UNDERFLOW .
- OVERFLOW indicates insufficient output buffer. It is represented by the
unique object
CoderResult.OVERFLOW .
- A malformed-input error indicates 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.
- An unmappable-character error indicates 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 | |
final public static CoderResult | OVERFLOW Result object used to signify that the out buffer does not have enough
space available in it to store the result of the encoding/decoding. | final public static CoderResult | UNDERFLOW Result object indicating that there is insufficient data in the
encoding/decoding buffer or that additional data is required. |
Method Summary | |
public boolean | isError() Answers true if this result represents a malformed-input error or an
unmappable-character error. | public boolean | isMalformed() Answers true if this result represents a malformed-input error. | public boolean | isOverflow() Answers true if this result is an overflow condition. | public boolean | isUnderflow() Answers true if this result is an underflow condition. | public boolean | isUnmappable() Answers true if this result represents an unmappable-character error. | public int | length() Gets the length of the erroneous input. | public static synchronized CoderResult | malformedForLength(int length) Gets a CoderResult object indicating a malformed-input
error. | public void | throwException() Throws an exception corresponding to this coder result. | public String | toString() Returns a text description of this result. | public static synchronized CoderResult | unmappableForLength(int length) Gets a CoderResult object indicating an unmappable
character error. |
OVERFLOW | final public static CoderResult OVERFLOW(Code) | | Result object used to signify that the out buffer does not have enough
space available in it to store the result of the encoding/decoding.
|
UNDERFLOW | final public static CoderResult UNDERFLOW(Code) | | Result object indicating that there is insufficient data in the
encoding/decoding buffer or that additional data is required.
|
isError | public boolean isError()(Code) | | Answers true if this result represents a malformed-input error or an
unmappable-character error.
true if a malformed-input error or an unmappable-character error,otherwise false |
isMalformed | public boolean isMalformed()(Code) | | Answers true if this result represents a malformed-input error.
true if a malformed-input error, otherwise false |
isOverflow | public boolean isOverflow()(Code) | | Answers true if this result is an overflow condition.
true if an overflow, otherwise false |
isUnderflow | public boolean isUnderflow()(Code) | | Answers true if this result is an underflow condition.
true if an underflow, otherwise false |
isUnmappable | public boolean isUnmappable()(Code) | | Answers true if this result represents an unmappable-character error.
true if an unmappable-character error, otherwise false |
length | public int length() throws UnsupportedOperationException(Code) | | Gets the length of the erroneous input. The length is only meaningful to
a malformed-input error or an unmappble character error.
the length, as an integer, of this object's erroneous input throws: UnsupportedOperationException - If this result is an overflow or underflow. |
malformedForLength | public static synchronized CoderResult malformedForLength(int length) throws IllegalArgumentException(Code) | | Gets a CoderResult object indicating a malformed-input
error.
Parameters: length - the length of the malformed-input a CoderResult object indicating a malformed-inputerror throws: IllegalArgumentException - If length is non-positive. |
toString | public String toString()(Code) | | Returns a text description of this result.
a text description of this result |
unmappableForLength | public static synchronized CoderResult unmappableForLength(int length) throws IllegalArgumentException(Code) | | Gets a CoderResult object indicating an unmappable
character error.
Parameters: length - the length of the input unit sequence denoting the unmappablecharacter a CoderResult object indicating an unmappablecharacter error throws: IllegalArgumentException - If length is non-positive. |
|
|
|