< prev index next >

src/java.base/share/classes/sun/nio/cs/ISO_8859_1.java

Print this page
rev 17642 : 8186517: sun.nio.cs.StandardCharsets$Aliases and Classes can be lazily loaded
Reviewed-by: sherman, martin, plevart


  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.nio.cs;
  27 
  28 import java.nio.ByteBuffer;
  29 import java.nio.CharBuffer;
  30 import java.nio.charset.Charset;
  31 import java.nio.charset.CharsetDecoder;
  32 import java.nio.charset.CharsetEncoder;
  33 import java.nio.charset.CoderResult;
  34 import java.util.Arrays;
  35 import java.util.Objects;
  36 
  37 import jdk.internal.HotSpotIntrinsicCandidate;
  38 
  39 class ISO_8859_1
  40     extends Charset
  41     implements HistoricallyNamedCharset
  42 {
  43 


  44     public ISO_8859_1() {
  45         super(StandardCharsets.ISO_8859_1, StandardCharsets.aliases_ISO_8859_1);
  46     }
  47 
  48     public String historicalName() {
  49         return "ISO8859_1";
  50     }
  51 
  52     public boolean contains(Charset cs) {
  53         return ((cs instanceof US_ASCII)
  54                 || (cs instanceof ISO_8859_1));
  55     }
  56 
  57     public CharsetDecoder newDecoder() {
  58         return new Decoder(this);
  59     }
  60 
  61     public CharsetEncoder newEncoder() {
  62         return new Encoder(this);
  63     }
  64 
  65     private static class Decoder extends CharsetDecoder




  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.nio.cs;
  27 
  28 import java.nio.ByteBuffer;
  29 import java.nio.CharBuffer;
  30 import java.nio.charset.Charset;
  31 import java.nio.charset.CharsetDecoder;
  32 import java.nio.charset.CharsetEncoder;
  33 import java.nio.charset.CoderResult;

  34 import java.util.Objects;
  35 
  36 import jdk.internal.HotSpotIntrinsicCandidate;
  37 
  38 public class ISO_8859_1
  39     extends Charset
  40     implements HistoricallyNamedCharset
  41 {
  42 
  43     public static final ISO_8859_1 INSTANCE = new ISO_8859_1();
  44 
  45     public ISO_8859_1() {
  46         super("ISO-8859-1", StandardCharsets.aliases_ISO_8859_1());
  47     }
  48 
  49     public String historicalName() {
  50         return "ISO8859_1";
  51     }
  52 
  53     public boolean contains(Charset cs) {
  54         return ((cs instanceof US_ASCII)
  55                 || (cs instanceof ISO_8859_1));
  56     }
  57 
  58     public CharsetDecoder newDecoder() {
  59         return new Decoder(this);
  60     }
  61 
  62     public CharsetEncoder newEncoder() {
  63         return new Encoder(this);
  64     }
  65 
  66     private static class Decoder extends CharsetDecoder


< prev index next >