Movatterモバイル変換


[0]ホーム

URL:


Skip navigation links
Java™ Platform
Standard Ed. 8

Package java.nio.charset

Defines charsets, decoders, and encoders, for translating between bytes andUnicode characters.

See: Description

Package java.nio.charset Description

Defines charsets, decoders, and encoders, for translating between bytes andUnicode characters.

Class name

Description

CharsetA named mapping between characters
and bytes
CharsetDecoderDecodes bytes into characters
CharsetEncoder  Encodes characters into bytes
CoderResult  Describes coder results
CodingErrorAction  Describes actions to take when
coding errors are detected

Acharset is named mapping between sequences of sixteen-bit Unicodecharacters and sequences of bytes, in the sense defined inRFC 2278. Adecoder is an engine which transforms bytes in a specific charset intocharacters, and anencoder is an engine which transforms characters intobytes. Encoders and decoders operate on byte and character buffers. They arecollectively referred to ascoders.

TheCharset class defines methods for creatingcoders for a given charset and for retrieving the various names associated witha charset. It also defines static methods for testing whether a particularcharset is supported, for locating charset instances by name, and forconstructing a map that contains every charset for which support is availablein the current Java virtual machine.

Most users will not use these classes directly; instead they will use theexisting charset-related constructors and methods in theString class, together with the existingInputStreamReader andOutputStreamWriter classes, allof whose implementations have been reworked to make use of the charsetfacilities defined in this package. A small number of changes have been madeto theInputStreamReader andOutputStreamWriterclasses in order to allow explicit charset objects to be specified in theconstruction of instances of those classes.

Support for new charsets can be made available via the interface defined intheCharsetProvider class in thejava.nio.charset.spi package.

Unless otherwise noted, passing anull argument to a constructoror method in any class or interface in this package will cause aNullPointerException to be thrown.

Since:
1.4
Skip navigation links
Java™ Platform
Standard Ed. 8


[8]ページ先頭

©2009-2025 Movatter.jp