jdk/src/java.base/share/classes/java/nio/charset/package.html
author chegar
Sun, 17 Aug 2014 15:54:13 +0100
changeset 25859 3317bb8137f4
parent 7668 jdk/src/share/classes/java/nio/charset/package.html@d4a77089c587
permissions -rw-r--r--
8054834: Modular Source Code Reviewed-by: alanb, chegar, ihse, mduigou Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, magnus.ihse.bursie@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, paul.sandoz@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
<!--
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 5820
diff changeset
     2
 Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
-->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
<!doctype html public "-//IETF//DTD HTML//EN">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
<html>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
<body bgcolor="white">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
Defines charsets, decoders, and encoders, for translating between bytes and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
Unicode characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
<blockquote><table cellspacing=1 cellpadding=0 summary="Summary of charsets, decoders, and encoders in this package">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 <tr><th><p align="left">Class name</p></th><th><p align="left">Description</p></th></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
  <tr><td valign=top><tt>{@link java.nio.charset.Charset}</tt></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
      <td>A named mapping between characters<br>and bytes</td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
  <tr><td valign=top><tt>{@link java.nio.charset.CharsetDecoder}</tt></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
      <td>Decodes bytes into characters</td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
  <tr><td valign=top><tt>{@link java.nio.charset.CharsetEncoder}&nbsp;&nbsp;</tt></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
      <td>Encodes characters into bytes</td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
  <tr><td valign=top><tt>{@link java.nio.charset.CoderResult}&nbsp;&nbsp;</tt></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
      <td>Describes coder results</td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
  <tr><td valign=top><tt>{@link java.nio.charset.CodingErrorAction}&nbsp;&nbsp;</tt></td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
      <td>Describes actions to take when<br>coding errors are detected</td></tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
</table></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
<p> A <i>charset</i> is named mapping between sequences of sixteen-bit Unicode
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
characters and sequences of bytes, in the sense defined in <a
5820
4f5e99470724 6967036: Need to fix links with // in Javadoc comments
ohair
parents: 5506
diff changeset
    51
href="http://www.ietf.org/rfc/rfc2278.txt"><i>RFC&nbsp;2278</i></a>.  A
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
<i>decoder</i> is an engine which transforms bytes in a specific charset into
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
characters, and an <i>encoder</i> is an engine which transforms characters into
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
bytes.  Encoders and decoders operate on byte and character buffers.  They are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
collectively referred to as <i>coders</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
<p> The {@link java.nio.charset.Charset} class defines methods for creating
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
coders for a given charset and for retrieving the various names associated with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
a charset.  It also defines static methods for testing whether a particular
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
charset is supported, for locating charset instances by name, and for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
constructing a map that contains every charset for which support is available
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
in the current Java virtual machine.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
<p> Most users will not use these classes directly; instead they will use the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
existing charset-related constructors and methods in the {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
java.lang.String} class, together with the existing {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
java.io.InputStreamReader} and {@link java.io.OutputStreamWriter} classes, all
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
of whose implementations have been reworked to make use of the charset
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
facilities defined in this package.  A small number of changes have been made
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
to the {@link java.io.InputStreamReader} and {@link java.io.OutputStreamWriter}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
classes in order to allow explicit charset objects to be specified in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
construction of instances of those classes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
<p> Support for new charsets can be made available via the interface defined in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
the {@link java.nio.charset.spi.CharsetProvider} class in the <tt>{@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
java.nio.charset.spi}</tt> package.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
<p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
or method in any class or interface in this package will cause a {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
java.lang.NullPointerException NullPointerException} to be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
@since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
@author Mark Reinhold
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
@author JSR-51 Expert Group
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
</body>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
</html>