|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.nio.charset.CoderResult
public class CoderResult
Used to indicate the result of encoding/decoding. There are four types of results:
CoderResult.UNDERFLOW.
CoderResult.OVERFLOW.
CoderResult.malformedForLength(int) with the length of the
malformed-input.
CoderResult.unmappableForLength(int) with the input
sequence size indicating the identity of the unmappable character.
| Field Summary | |
|---|---|
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. |
static CoderResult |
UNDERFLOW
Result object indicating that there is insufficient data in the encoding/decoding buffer or that additional data is required. |
| 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. |
static CoderResult |
malformedForLength(int length)
Gets a CoderResult object indicating a malformed-input
error. |
void |
throwException()
Throws an exception corresponding to this coder result. |
String |
toString()
Returns a text description of this result. |
static CoderResult |
unmappableForLength(int length)
Gets a CoderResult object indicating an unmappable
character error. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final CoderResult UNDERFLOW
public static final CoderResult OVERFLOW
| Method Detail |
|---|
public static CoderResult malformedForLength(int length)
throws IllegalArgumentException
CoderResult object indicating a malformed-input
error.
length - the length of the malformed-input
CoderResult object indicating a malformed-input
error
IllegalArgumentException - If length is non-positive.
public static CoderResult unmappableForLength(int length)
throws IllegalArgumentException
CoderResult object indicating an unmappable
character error.
length - the length of the input unit sequence denoting the unmappable
character
CoderResult object indicating an unmappable
character error
IllegalArgumentException - If length is non-positive.public boolean isUnderflow()
public boolean isError()
public boolean isMalformed()
public boolean isOverflow()
public boolean isUnmappable()
public int length()
throws UnsupportedOperationException
UnsupportedOperationException - If this result is an overflow or underflow.
public void throwException()
throws BufferUnderflowException,
BufferOverflowException,
UnmappableCharacterException,
MalformedInputException,
CharacterCodingException
BufferUnderflowException - If an underflow.
BufferOverflowException - If an overflow.
UnmappableCharacterException - If an unmappable-character error.
MalformedInputException - If a malformed-input error.
CharacterCodingException - The default exception.public String toString()
toString in class Object
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||