java.nio.charset |
|
Java Source File Name | Type | Comment |
CharacterCodingException.java | Class | Type of exception thrown when an encoding or decoding error occurs. |
Charset.java | Class | A charset defines a mapping between a Unicode character sequence and a byte
sequence. |
CharsetDecoder.java | Class | An converter that can convert bytes sequence in some charset to 16-bit
Unicode character sequence.
The input byte sequence is wrapped by
java.nio.ByteBuffer ByteBuffer and the output character sequence is
java.nio.CharBuffer CharBuffer .
A decoder instance should be used in following sequence, which is referred to
as a decoding operation:
- Invoking the
CharsetDecoder.reset() reset method to reset the decoder if the
decoder has been used;
- Invoking the
CharsetDecoder.decode(ByteBuffer,CharBuffer,boolean) decode method until the additional input is not needed, the
endOfInput
parameter must be set to false, the input buffer must be filled and the
output buffer must be flushed between invocations;
- Invoking the
CharsetDecoder.decode(ByteBuffer,CharBuffer,boolean) decode method last time, and the the
endOfInput parameter must be set
to true
- Invoking the
CharsetDecoder.flush(CharBuffer) flush method to flush the
output.
The
CharsetDecoder.decode(ByteBuffer,CharBuffer,boolean) decode method will
convert as many bytes as possible, and the process won't stop except the
input bytes has been run out of, the output buffer has been filled or some
error has happened. |
CharsetEncoder.java | Class | An converter that can convert 16-bit Unicode character sequence to byte
sequence in some charset .
The input character sequence is wrapped by
java.nio.CharBuffer CharBuffer and the output character sequence is
java.nio.ByteBuffer ByteBuffer . |
CoderMalfunctionError.java | Class | Errors thrown when the encoder/decoder is malfunctioning. |
CoderResult.java | Class | Used to indicate the result of encoding/decoding. |
CodingErrorAction.java | Class | Used to indicate what kind of actions to take in case of encoding/decoding
errors. |
IllegalCharsetNameException.java | Class | Thrown when an illegal charset name is encountered. |
MalformedInputException.java | Class | Thrown when a malformed input is encountered, for example, a byte sequence is
illegal for the given charset. |
UnmappableCharacterException.java | Class | Thrown when an unmappable character for the given charset is encountered. |
UnsupportedCharsetException.java | Class | Thrown when an unsupported charset name is encountered. |