Liking cljdoc? Tell your friends :D

jdk.nio.charset.CharacterCodingException

Checked exception thrown when a character encoding or decoding error occurs.

Checked exception thrown when a character encoding
or decoding error occurs.
raw docstring

jdk.nio.charset.Charset

A named mapping between sequences of sixteen-bit Unicode code units and sequences of bytes. This class defines methods for creating decoders and encoders and for retrieving the various names associated with a charset. Instances of this class are immutable.

This class also defines static methods for testing whether a particular charset is supported, for locating charset instances by name, and for constructing a map that contains every charset for which support is available in the current Java virtual machine. Support for new charsets can be added via the service-provider interface defined in the CharsetProvider class.

All of the methods defined in this class are safe for use by multiple concurrent threads.

Charset names

Charsets are named by strings composed of the following characters:

The uppercase letters 'A' through 'Z' ('\u0041' through '\u005a'),

The lowercase letters 'a' through 'z' ('\u0061' through '\u007a'),

The digits '0' through '9' ('\u0030' through '\u0039'),

The dash character '-' ('\u002d', HYPHEN-MINUS),

The plus character '+' ('\u002b', PLUS SIGN),

The period character '.' ('\u002e', FULL STOP),

The colon character ':' ('\u003a', COLON), and

The underscore character '_' ('\u005f', LOW LINE).

A charset name must begin with either a letter or a digit. The empty string is not a legal charset name. Charset names are not case-sensitive; that is, case is always ignored when comparing charset names. Charset names generally follow the conventions documented in RFC 2278: IANA Charset Registration Procedures.

Every charset has a canonical name and may also have one or more aliases. The canonical name is returned by the name method of this class. Canonical names are, by convention, usually in upper case. The aliases of a charset are returned by the aliases method.

Some charsets have an historical name that is defined for compatibility with previous versions of the Java platform. A charset's historical name is either its canonical name or one of its aliases. The historical name is returned by the getEncoding() methods of the InputStreamReader and OutputStreamWriter classes.

If a charset listed in the IANA Charset Registry is supported by an implementation of the Java platform then its canonical name must be the name listed in the registry. Many charsets are given more than one name in the registry, in which case the registry identifies one of the names as MIME-preferred. If a charset has more than one registry name then its canonical name must be the MIME-preferred name and the other names in the registry must be valid aliases. If a supported charset is not listed in the IANA registry then its canonical name must begin with one of the strings "X-" or "x-".

The IANA charset registry does change over time, and so the canonical name and the aliases of a particular charset may also change over time. To ensure compatibility it is recommended that no alias ever be removed from a charset, and that if the canonical name of a charset is changed then its previous canonical name be made into an alias.

Standard charsets

Every implementation of the Java platform is required to support the following standard charsets. Consult the release documentation for your implementation to see if any other charsets are supported. The behavior of such optional charsets may differ between implementations.

CharsetDescription US-ASCII Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set ISO-8859-1 ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1 UTF-8 Eight-bit UCS Transformation Format UTF-16BE Sixteen-bit UCS Transformation Format, big-endian byte order UTF-16LE Sixteen-bit UCS Transformation Format, little-endian byte order UTF-16 Sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark

The UTF-8 charset is specified by RFC 2279; the transformation format upon which it is based is specified in Amendment 2 of ISO 10646-1 and is also described in the Unicode Standard.

The UTF-16 charsets are specified by RFC 2781; the transformation formats upon which they are based are specified in Amendment 1 of ISO 10646-1 and are also described in the Unicode Standard.

The UTF-16 charsets use sixteen-bit quantities and are therefore sensitive to byte order. In these encodings the byte order of a stream may be indicated by an initial byte-order mark represented by the Unicode character '\uFEFF'. Byte-order marks are handled as follows:

When decoding, the UTF-16BE and UTF-16LE charsets interpret the initial byte-order marks as a ZERO-WIDTH NON-BREAKING SPACE; when encoding, they do not write byte-order marks.

When decoding, the UTF-16 charset interprets the byte-order mark at the beginning of the input stream to indicate the byte-order of the stream but defaults to big-endian if there is no byte-order mark; when encoding, it uses big-endian byte order and writes a big-endian byte-order mark.

In any case, byte order marks occurring after the first element of an input sequence are not omitted since the same code is used to represent ZERO-WIDTH NON-BREAKING SPACE.

Every instance of the Java virtual machine has a default charset, which may or may not be one of the standard charsets. The default charset is determined during virtual-machine startup and typically depends upon the locale and charset being used by the underlying operating system.

The StandardCharsets class defines constants for each of the standard charsets.

Terminology

The name of this class is taken from the terms used in RFC 2278. In that document a charset is defined as the combination of one or more coded character sets and a character-encoding scheme. (This definition is confusing; some other software systems define charset as a synonym for coded character set.)

A coded character set is a mapping between a set of abstract characters and a set of integers. US-ASCII, ISO 8859-1, JIS X 0201, and Unicode are examples of coded character sets.

Some standards have defined a character set to be simply a set of abstract characters without an associated assigned numbering. An alphabet is an example of such a character set. However, the subtle distinction between character set and coded character set is rarely used in practice; the former has become a short form for the latter, including in the Java API specification.

A character-encoding scheme is a mapping between one or more coded character sets and a set of octet (eight-bit byte) sequences. UTF-8, UTF-16, ISO 2022, and EUC are examples of character-encoding schemes. Encoding schemes are often associated with a particular coded character set; UTF-8, for example, is used only to encode Unicode. Some schemes, however, are associated with multiple coded character sets; EUC, for example, can be used to encode characters in a variety of Asian coded character sets.

When a coded character set is used exclusively with a single character-encoding scheme then the corresponding charset is usually named for the coded character set; otherwise a charset is usually named for the encoding scheme and, possibly, the locale of the coded character sets that it supports. Hence US-ASCII is both the name of a coded character set and of the charset that encodes it, while EUC-JP is the name of the charset that encodes the JIS X 0201, JIS X 0208, and JIS X 0212 coded character sets for the Japanese language.

The native character encoding of the Java programming language is UTF-16. A charset in the Java platform therefore defines a mapping between sequences of sixteen-bit UTF-16 code units (that is, sequences of chars) and sequences of bytes.

A named mapping between sequences of sixteen-bit Unicode code units and sequences of
bytes.  This class defines methods for creating decoders and encoders and
for retrieving the various names associated with a charset.  Instances of
this class are immutable.

 This class also defines static methods for testing whether a particular
charset is supported, for locating charset instances by name, and for
constructing a map that contains every charset for which support is
available in the current Java virtual machine.  Support for new charsets can
be added via the service-provider interface defined in the CharsetProvider class.

 All of the methods defined in this class are safe for use by multiple
concurrent threads.



Charset names

 Charsets are named by strings composed of the following characters:



   The uppercase letters 'A' through 'Z'
       ('\u0041' through '\u005a'),

   The lowercase letters 'a' through 'z'
       ('\u0061' through '\u007a'),

   The digits '0' through '9'
       ('\u0030' through '\u0039'),

   The dash character '-'
       ('\u002d', HYPHEN-MINUS),

   The plus character '+'
       ('\u002b', PLUS SIGN),

   The period character '.'
       ('\u002e', FULL STOP),

   The colon character ':'
       ('\u003a', COLON), and

   The underscore character '_'
       ('\u005f', LOW LINE).



A charset name must begin with either a letter or a digit.  The empty string
is not a legal charset name.  Charset names are not case-sensitive; that is,
case is always ignored when comparing charset names.  Charset names
generally follow the conventions documented in RFC 2278: IANA Charset
Registration Procedures.

 Every charset has a canonical name and may also have one or more
aliases.  The canonical name is returned by the name method
of this class.  Canonical names are, by convention, usually in upper case.
The aliases of a charset are returned by the aliases
method.

Some charsets have an historical name that is defined for
compatibility with previous versions of the Java platform.  A charset's
historical name is either its canonical name or one of its aliases.  The
historical name is returned by the getEncoding() methods of the
InputStreamReader and OutputStreamWriter classes.

 If a charset listed in the IANA Charset
Registry is supported by an implementation of the Java platform then
its canonical name must be the name listed in the registry. Many charsets
are given more than one name in the registry, in which case the registry
identifies one of the names as MIME-preferred.  If a charset has more
than one registry name then its canonical name must be the MIME-preferred
name and the other names in the registry must be valid aliases.  If a
supported charset is not listed in the IANA registry then its canonical name
must begin with one of the strings "X-" or "x-".

 The IANA charset registry does change over time, and so the canonical
name and the aliases of a particular charset may also change over time.  To
ensure compatibility it is recommended that no alias ever be removed from a
charset, and that if the canonical name of a charset is changed then its
previous canonical name be made into an alias.


Standard charsets



Every implementation of the Java platform is required to support the
following standard charsets.  Consult the release documentation for your
implementation to see if any other charsets are supported.  The behavior
of such optional charsets may differ between implementations.


CharsetDescription
US-ASCII
    Seven-bit ASCII, a.k.a. ISO646-US,
        a.k.a. the Basic Latin block of the Unicode character set
ISO-8859-1
    ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1
UTF-8
    Eight-bit UCS Transformation Format
UTF-16BE
    Sixteen-bit UCS Transformation Format,
        big-endian byte order
UTF-16LE
    Sixteen-bit UCS Transformation Format,
        little-endian byte order
UTF-16
    Sixteen-bit UCS Transformation Format,
        byte order identified by an optional byte-order mark


 The UTF-8 charset is specified by RFC 2279; the
transformation format upon which it is based is specified in
Amendment 2 of ISO 10646-1 and is also described in the Unicode
Standard.

 The UTF-16 charsets are specified by RFC 2781; the
transformation formats upon which they are based are specified in
Amendment 1 of ISO 10646-1 and are also described in the Unicode
Standard.

 The UTF-16 charsets use sixteen-bit quantities and are
therefore sensitive to byte order.  In these encodings the byte order of a
stream may be indicated by an initial byte-order mark represented by
the Unicode character '\uFEFF'.  Byte-order marks are handled
as follows:



   When decoding, the UTF-16BE and UTF-16LE
  charsets interpret the initial byte-order marks as a ZERO-WIDTH
  NON-BREAKING SPACE; when encoding, they do not write
  byte-order marks.


   When decoding, the UTF-16 charset interprets the
  byte-order mark at the beginning of the input stream to indicate the
  byte-order of the stream but defaults to big-endian if there is no
  byte-order mark; when encoding, it uses big-endian byte order and writes
  a big-endian byte-order mark.



In any case, byte order marks occurring after the first element of an
input sequence are not omitted since the same code is used to represent
ZERO-WIDTH NON-BREAKING SPACE.

 Every instance of the Java virtual machine has a default charset, which
may or may not be one of the standard charsets.  The default charset is
determined during virtual-machine startup and typically depends upon the
locale and charset being used by the underlying operating system.

The StandardCharsets class defines constants for each of the
standard charsets.

Terminology

 The name of this class is taken from the terms used in
RFC 2278.
In that document a charset is defined as the combination of
one or more coded character sets and a character-encoding scheme.
(This definition is confusing; some other software systems define
charset as a synonym for coded character set.)

 A coded character set is a mapping between a set of abstract
characters and a set of integers.  US-ASCII, ISO 8859-1,
JIS X 0201, and Unicode are examples of coded character sets.

 Some standards have defined a character set to be simply a
set of abstract characters without an associated assigned numbering.
An alphabet is an example of such a character set.  However, the subtle
distinction between character set and coded character set
is rarely used in practice; the former has become a short form for the
latter, including in the Java API specification.

 A character-encoding scheme is a mapping between one or more
coded character sets and a set of octet (eight-bit byte) sequences.
UTF-8, UTF-16, ISO 2022, and EUC are examples of
character-encoding schemes.  Encoding schemes are often associated with
a particular coded character set; UTF-8, for example, is used only to
encode Unicode.  Some schemes, however, are associated with multiple
coded character sets; EUC, for example, can be used to encode
characters in a variety of Asian coded character sets.

 When a coded character set is used exclusively with a single
character-encoding scheme then the corresponding charset is usually
named for the coded character set; otherwise a charset is usually named
for the encoding scheme and, possibly, the locale of the coded
character sets that it supports.  Hence US-ASCII is both the
name of a coded character set and of the charset that encodes it, while
EUC-JP is the name of the charset that encodes the
JIS X 0201, JIS X 0208, and JIS X 0212
coded character sets for the Japanese language.

 The native character encoding of the Java programming language is
UTF-16.  A charset in the Java platform therefore defines a mapping
between sequences of sixteen-bit UTF-16 code units (that is, sequences
of chars) and sequences of bytes.
raw docstring

jdk.nio.charset.CharsetDecoder

An engine that can transform a sequence of bytes in a specific charset into a sequence of sixteen-bit Unicode characters.

The input byte sequence is provided in a byte buffer or a series of such buffers. The output character sequence is written to a character buffer or a series of such buffers. A decoder should always be used by making the following sequence of method invocations, hereinafter referred to as a decoding operation:

Reset the decoder via the reset method, unless it has not been used before;

Invoke the decode method zero or more times, as long as additional input may be available, passing false for the endOfInput argument and filling the input buffer and flushing the output buffer between invocations;

Invoke the decode method one final time, passing true for the endOfInput argument; and then

Invoke the flush method so that the decoder can flush any internal state to the output buffer.

Each invocation of the decode method will decode as many bytes as possible from the input buffer, writing the resulting characters to the output buffer. The decode method returns when more input is required, when there is not enough room in the output buffer, or when a decoding error has occurred. In each case a CoderResult object is returned to describe the reason for termination. An invoker can examine this object and fill the input buffer, flush the output buffer, or attempt to recover from a decoding error, as appropriate, and try again.

There are two general types of decoding errors. If the input byte sequence is not legal for this charset then the input is considered malformed. If the input byte sequence is legal but cannot be mapped to a valid Unicode character then an unmappable character has been encountered.

How a decoding error is handled depends upon the action requested for that type of error, which is described by an instance of the CodingErrorAction class. The possible error actions are to ignore the erroneous input, report the error to the invoker via the returned CoderResult object, or replace the erroneous input with the current value of the replacement string. The replacement

has the initial value "\uFFFD";

its value may be changed via the replaceWith method.

The default action for malformed-input and unmappable-character errors is to report them. The malformed-input error action may be changed via the onMalformedInput method; the unmappable-character action may be changed via the onUnmappableCharacter method.

This class is designed to handle many of the details of the decoding process, including the implementation of error actions. A decoder for a specific charset, which is a concrete subclass of this class, need only implement the abstract decodeLoop method, which encapsulates the basic decoding loop. A subclass that maintains internal state should, additionally, override the implFlush and implReset methods.

Instances of this class are not safe for use by multiple concurrent threads.

An engine that can transform a sequence of bytes in a specific charset into a sequence of
sixteen-bit Unicode characters.



 The input byte sequence is provided in a byte buffer or a series
of such buffers.  The output character sequence is written to a character buffer
or a series of such buffers.  A decoder should always be used by making
the following sequence of method invocations, hereinafter referred to as a
decoding operation:



   Reset the decoder via the reset method, unless it
  has not been used before;

   Invoke the decode method zero or more times, as
  long as additional input may be available, passing false for the
  endOfInput argument and filling the input buffer and flushing the
  output buffer between invocations;

   Invoke the decode method one final time, passing
  true for the endOfInput argument; and then

   Invoke the flush method so that the decoder can
  flush any internal state to the output buffer.



Each invocation of the decode method will decode as many
bytes as possible from the input buffer, writing the resulting characters
to the output buffer.  The decode method returns when more
input is required, when there is not enough room in the output buffer, or
when a decoding error has occurred.  In each case a CoderResult
object is returned to describe the reason for termination.  An invoker can
examine this object and fill the input buffer, flush the output buffer, or
attempt to recover from a decoding error, as appropriate, and try again.



 There are two general types of decoding errors.  If the input byte
sequence is not legal for this charset then the input is considered malformed.  If
the input byte sequence is legal but cannot be mapped to a valid
Unicode character then an unmappable character has been encountered.



 How a decoding error is handled depends upon the action requested for
that type of error, which is described by an instance of the CodingErrorAction class.  The possible error actions are to ignore the erroneous input, report the error to the invoker via
the returned CoderResult object, or replace the erroneous input with the current value of the
replacement string.  The replacement






has the initial value "\uFFFD";


its value may be changed via the replaceWith method.

 The default action for malformed-input and unmappable-character errors
is to report them.  The
malformed-input error action may be changed via the onMalformedInput method; the
unmappable-character action may be changed via the onUnmappableCharacter method.

 This class is designed to handle many of the details of the decoding
process, including the implementation of error actions.  A decoder for a
specific charset, which is a concrete subclass of this class, need only
implement the abstract decodeLoop method, which
encapsulates the basic decoding loop.  A subclass that maintains internal
state should, additionally, override the implFlush and
implReset methods.

 Instances of this class are not safe for use by multiple concurrent
threads.
raw docstring

jdk.nio.charset.CharsetEncoder

An engine that can transform a sequence of sixteen-bit Unicode characters into a sequence of bytes in a specific charset.

The input character sequence is provided in a character buffer or a series of such buffers. The output byte sequence is written to a byte buffer or a series of such buffers. An encoder should always be used by making the following sequence of method invocations, hereinafter referred to as an encoding operation:

Reset the encoder via the reset method, unless it has not been used before;

Invoke the encode method zero or more times, as long as additional input may be available, passing false for the endOfInput argument and filling the input buffer and flushing the output buffer between invocations;

Invoke the encode method one final time, passing true for the endOfInput argument; and then

Invoke the flush method so that the encoder can flush any internal state to the output buffer.

Each invocation of the encode method will encode as many characters as possible from the input buffer, writing the resulting bytes to the output buffer. The encode method returns when more input is required, when there is not enough room in the output buffer, or when an encoding error has occurred. In each case a CoderResult object is returned to describe the reason for termination. An invoker can examine this object and fill the input buffer, flush the output buffer, or attempt to recover from an encoding error, as appropriate, and try again.

There are two general types of encoding errors. If the input character sequence is not a legal sixteen-bit Unicode sequence then the input is considered malformed. If the input character sequence is legal but cannot be mapped to a valid byte sequence in the given charset then an unmappable character has been encountered.

How an encoding error is handled depends upon the action requested for that type of error, which is described by an instance of the CodingErrorAction class. The possible error actions are to ignore the erroneous input, report the error to the invoker via the returned CoderResult object, or replace the erroneous input with the current value of the replacement byte array. The replacement

is initially set to the encoder's default replacement, which often (but not always) has the initial value { (byte)'?' };

its value may be changed via the replaceWith method.

The default action for malformed-input and unmappable-character errors is to report them. The malformed-input error action may be changed via the onMalformedInput method; the unmappable-character action may be changed via the onUnmappableCharacter method.

This class is designed to handle many of the details of the encoding process, including the implementation of error actions. An encoder for a specific charset, which is a concrete subclass of this class, need only implement the abstract encodeLoop method, which encapsulates the basic encoding loop. A subclass that maintains internal state should, additionally, override the implFlush and implReset methods.

Instances of this class are not safe for use by multiple concurrent threads.

An engine that can transform a sequence of sixteen-bit Unicode characters into a sequence of
bytes in a specific charset.



 The input character sequence is provided in a character buffer or a series
of such buffers.  The output byte sequence is written to a byte buffer
or a series of such buffers.  An encoder should always be used by making
the following sequence of method invocations, hereinafter referred to as an
encoding operation:



   Reset the encoder via the reset method, unless it
  has not been used before;

   Invoke the encode method zero or more times, as
  long as additional input may be available, passing false for the
  endOfInput argument and filling the input buffer and flushing the
  output buffer between invocations;

   Invoke the encode method one final time, passing
  true for the endOfInput argument; and then

   Invoke the flush method so that the encoder can
  flush any internal state to the output buffer.



Each invocation of the encode method will encode as many
characters as possible from the input buffer, writing the resulting bytes
to the output buffer.  The encode method returns when more
input is required, when there is not enough room in the output buffer, or
when an encoding error has occurred.  In each case a CoderResult
object is returned to describe the reason for termination.  An invoker can
examine this object and fill the input buffer, flush the output buffer, or
attempt to recover from an encoding error, as appropriate, and try again.



 There are two general types of encoding errors.  If the input character
sequence is not a legal sixteen-bit Unicode sequence then the input is considered malformed.  If
the input character sequence is legal but cannot be mapped to a valid
byte sequence in the given charset then an unmappable character has been encountered.



 How an encoding error is handled depends upon the action requested for
that type of error, which is described by an instance of the CodingErrorAction class.  The possible error actions are to ignore the erroneous input, report the error to the invoker via
the returned CoderResult object, or replace the erroneous input with the current value of the
replacement byte array.  The replacement


is initially set to the encoder's default replacement, which often
(but not always) has the initial value { (byte)'?' };





its value may be changed via the replaceWith method.

 The default action for malformed-input and unmappable-character errors
is to report them.  The
malformed-input error action may be changed via the onMalformedInput method; the
unmappable-character action may be changed via the onUnmappableCharacter method.

 This class is designed to handle many of the details of the encoding
process, including the implementation of error actions.  An encoder for a
specific charset, which is a concrete subclass of this class, need only
implement the abstract encodeLoop method, which
encapsulates the basic encoding loop.  A subclass that maintains internal
state should, additionally, override the implFlush and
implReset methods.

 Instances of this class are not safe for use by multiple concurrent
threads.
raw docstring

jdk.nio.charset.CoderMalfunctionError

Error thrown when the decodeLoop method of a CharsetDecoder, or the encodeLoop method of a CharsetEncoder, throws an unexpected exception.

Error thrown when the decodeLoop method of
a CharsetDecoder, or the encodeLoop method of a CharsetEncoder, throws an unexpected
exception.
raw docstring

jdk.nio.charset.CoderResult

A description of the result state of a coder.

A charset coder, that is, either a decoder or an encoder, consumes bytes (or characters) from an input buffer, translates them, and writes the resulting characters (or bytes) to an output buffer. A coding process terminates for one of four categories of reasons, which are described by instances of this class:

Underflow is reported when there is no more input to be processed, or there is insufficient input and additional input is required. This condition is represented by the unique result object UNDERFLOW, whose isUnderflow method returns true.

Overflow is reported when there is insufficient room remaining in the output buffer. This condition is represented by the unique result object OVERFLOW, whose isOverflow method returns true.

A malformed-input error is reported when a sequence of input units is not well-formed. Such errors are described by instances of this class whose isMalformed method returns true and whose length method returns the length of the malformed sequence. There is one unique instance of this class for all malformed-input errors of a given length.

An unmappable-character error is reported when a sequence of input units denotes a character that cannot be represented in the output charset. Such errors are described by instances of this class whose isUnmappable method returns true and whose length method returns the length of the input sequence denoting the unmappable character. There is one unique instance of this class for all unmappable-character errors of a given length.

For convenience, the isError method returns true for result objects that describe malformed-input and unmappable-character errors but false for those that describe underflow or overflow conditions.

A description of the result state of a coder.

 A charset coder, that is, either a decoder or an encoder, consumes bytes
(or characters) from an input buffer, translates them, and writes the
resulting characters (or bytes) to an output buffer.  A coding process
terminates for one of four categories of reasons, which are described by
instances of this class:



   Underflow is reported when there is no more input to be
  processed, or there is insufficient input and additional input is
  required.  This condition is represented by the unique result object
  UNDERFLOW, whose isUnderflow method
  returns true.

   Overflow is reported when there is insufficient room
  remaining in the output buffer.  This condition is represented by the
  unique result object OVERFLOW, whose isOverflow method returns true.

   A malformed-input error is reported when a sequence of
  input units is not well-formed.  Such errors are described by instances of
  this class whose isMalformed method returns
  true and whose length method returns the length
  of the malformed sequence.  There is one unique instance of this class for
  all malformed-input errors of a given length.

   An unmappable-character error is reported when a sequence
  of input units denotes a character that cannot be represented in the
  output charset.  Such errors are described by instances of this class
  whose isUnmappable method returns true and
  whose length method returns the length of the input
  sequence denoting the unmappable character.  There is one unique instance
  of this class for all unmappable-character errors of a given length.




 For convenience, the isError method returns true
for result objects that describe malformed-input and unmappable-character
errors but false for those that describe underflow or overflow
conditions.
raw docstring

jdk.nio.charset.CodingErrorAction

A typesafe enumeration for coding-error actions.

Instances of this class are used to specify how malformed-input and unmappable-character errors are to be handled by charset decoders and encoders.

A typesafe enumeration for coding-error actions.

 Instances of this class are used to specify how malformed-input and
unmappable-character errors are to be handled by charset decoders and encoders.
raw docstring

jdk.nio.charset.core

No vars found in this namespace.

jdk.nio.charset.IllegalCharsetNameException

Unchecked exception thrown when a string that is not a legal charset name is used as such.

Unchecked exception thrown when a string that is not a
legal charset name is used as such.
raw docstring

jdk.nio.charset.MalformedInputException

Checked exception thrown when an input byte sequence is not legal for given charset, or an input character sequence is not a legal sixteen-bit Unicode sequence.

Checked exception thrown when an input byte sequence is not legal for given
charset, or an input character sequence is not a legal sixteen-bit Unicode
sequence.
raw docstring

jdk.nio.charset.spi.CharsetProvider

Charset service-provider class.

A charset provider is a concrete subclass of this class that has a zero-argument constructor and some number of associated charset implementation classes. Charset providers may be installed in an instance of the Java platform as extensions, that is, jar files placed into any of the usual extension directories. Providers may also be made available by adding them to the applet or application class path or by some other platform-specific means. Charset providers are looked up via the current thread's context class loader.

A charset provider identifies itself with a provider-configuration file named java.nio.charset.spi.CharsetProvider in the resource directory META-INF/services. The file should contain a list of fully-qualified concrete charset-provider class names, one per line. A line is terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a line feed. Space and tab characters surrounding each name, as well as blank lines, are ignored. The comment character is '#' ('\u0023'); on each line all characters following the first comment character are ignored. The file must be encoded in UTF-8.

If a particular concrete charset provider class is named in more than one configuration file, or is named in the same configuration file more than once, then the duplicates will be ignored. The configuration file naming a particular provider need not be in the same jar file or other distribution unit as the provider itself. The provider must be accessible from the same class loader that was initially queried to locate the configuration file; this is not necessarily the class loader that loaded the file.

Charset service-provider class.

 A charset provider is a concrete subclass of this class that has a
zero-argument constructor and some number of associated charset
implementation classes.  Charset providers may be installed in an instance
of the Java platform as extensions, that is, jar files placed into any of
the usual extension directories.  Providers may also be made available by
adding them to the applet or application class path or by some other
platform-specific means.  Charset providers are looked up via the current
thread's context class
loader.

 A charset provider identifies itself with a provider-configuration file
named java.nio.charset.spi.CharsetProvider in the resource
directory META-INF/services.  The file should contain a list of
fully-qualified concrete charset-provider class names, one per line.  A line
is terminated by any one of a line feed ('\n'), a carriage return
('\r'), or a carriage return followed immediately by a line feed.
Space and tab characters surrounding each name, as well as blank lines, are
ignored.  The comment character is '#' ('\u0023'); on
each line all characters following the first comment character are ignored.
The file must be encoded in UTF-8.

 If a particular concrete charset provider class is named in more than
one configuration file, or is named in the same configuration file more than
once, then the duplicates will be ignored.  The configuration file naming a
particular provider need not be in the same jar file or other distribution
unit as the provider itself.  The provider must be accessible from the same
class loader that was initially queried to locate the configuration file;
this is not necessarily the class loader that loaded the file.
raw docstring

jdk.nio.charset.spi.core

No vars found in this namespace.

jdk.nio.charset.StandardCharsets

Constant definitions for the standard Charsets. These charsets are guaranteed to be available on every implementation of the Java platform.

Constant definitions for the standard Charsets. These
charsets are guaranteed to be available on every implementation of the Java
platform.
raw docstring

jdk.nio.charset.UnmappableCharacterException

Checked exception thrown when an input character (or byte) sequence is valid but cannot be mapped to an output byte (or character) sequence.

Checked exception thrown when an input character (or byte) sequence
is valid but cannot be mapped to an output byte (or character)
sequence.
raw docstring

jdk.nio.charset.UnsupportedCharsetException

Unchecked exception thrown when no support is available for a requested charset.

Unchecked exception thrown when no support is available
for a requested charset.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close