Path: blob/master/src/java.base/share/classes/java/nio/charset/StandardCharsets.java
41159 views
/*1* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24package java.nio.charset;2526/**27* Constant definitions for the standard {@link Charset charsets}. These28* charsets are guaranteed to be available on every implementation of the Java29* platform.30*31* @see <a href="Charset.html#standard">Standard Charsets</a>32* @since 1.733*/34public final class StandardCharsets {3536// To avoid accidental eager initialization of often unused Charsets37// from happening while the VM is booting up, which may delay38// initialization of VM components, we should generally avoid depending39// on this class from elsewhere in java.base.4041private StandardCharsets() {42throw new AssertionError("No java.nio.charset.StandardCharsets instances for you!");43}4445/**46* Seven-bit ASCII, also known as ISO646-US, also known as the47* Basic Latin block of the Unicode character set.48*/49public static final Charset US_ASCII = sun.nio.cs.US_ASCII.INSTANCE;5051/**52* ISO Latin Alphabet {@literal No. 1}, also known as ISO-LATIN-1.53*/54public static final Charset ISO_8859_1 = sun.nio.cs.ISO_8859_1.INSTANCE;5556/**57* Eight-bit UCS Transformation Format.58*/59public static final Charset UTF_8 = sun.nio.cs.UTF_8.INSTANCE;6061/**62* Sixteen-bit UCS Transformation Format, big-endian byte order.63*/64public static final Charset UTF_16BE = new sun.nio.cs.UTF_16BE();6566/**67* Sixteen-bit UCS Transformation Format, little-endian byte order.68*/69public static final Charset UTF_16LE = new sun.nio.cs.UTF_16LE();7071/**72* Sixteen-bit UCS Transformation Format, byte order identified by an73* optional byte-order mark.74*/75public static final Charset UTF_16 = new sun.nio.cs.UTF_16();76}777879