DoubleByte-X.java.template revision 2362
0N/A/*
1879N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
0N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
1472N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1472N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A * or visit www.oracle.com if you need additional information or have any
0N/A * questions.
0N/A */
1879N/A
1879N/A// -- This file was mechanically generated: Do not edit! -- //
1879N/A
1879N/Apackage $PACKAGE$;
1879N/A
0N/Aimport java.nio.charset.Charset;
0N/Aimport java.nio.charset.CharsetDecoder;
0N/Aimport java.nio.charset.CharsetEncoder;
0N/Aimport java.util.Arrays;
0N/Aimport sun.nio.cs.HistoricallyNamedCharset;
0N/Aimport sun.nio.cs.ext.DoubleByte;
0N/A
605N/Apublic class $NAME_CLZ$ extends Charset
0N/A $IMPLEMENTS$
0N/A{
0N/A public $NAME_CLZ$() {
0N/A super("$NAME_CS$", $NAME_ALIASES$);
0N/A }
0N/A
0N/A $HISTORICALNAME$
0N/A
0N/A public boolean contains(Charset cs) {
0N/A $CONTAINS$
0N/A }
0N/A
0N/A public CharsetDecoder newDecoder() {
0N/A initb2c();
0N/A return new DoubleByte.Decoder$DECTYPE$(this, b2c, b2cSB, $B2MIN$, $B2MAX$);
0N/A }
0N/A
0N/A public CharsetEncoder newEncoder() {
0N/A initc2b();
0N/A return new DoubleByte.Encoder$ENCTYPE$(this, c2b, c2bIndex);
0N/A }
1879N/A
1879N/A $B2C$
static char[][] b2c = new char[b2cStr.length][];
static char[] b2cSB;
private static volatile boolean b2cInitialized = false;
static void initb2c() {
if (b2cInitialized)
return;
synchronized (b2c) {
if (b2cInitialized)
return;
for (int i = 0; i < b2cStr.length; i++) {
if (b2cStr[i] == null)
b2c[i] = DoubleByte.B2C_UNMAPPABLE;
else
b2c[i] = b2cStr[i].toCharArray();
}
b2cSB = b2cSBStr.toCharArray();
b2cInitialized = true;
}
}
static char[] c2b = new char[$C2BLENGTH$];
static char[] c2bIndex = new char[0x100];
private static volatile boolean c2bInitialized = false;
static void initc2b() {
if (c2bInitialized)
return;
synchronized (c2b) {
if (c2bInitialized)
return;
$NONROUNDTRIP_B2C$
$NONROUNDTRIP_C2B$
DoubleByte.Encoder.initC2B(b2cStr, b2cSBStr, b2cNR, c2bNR,
$B2MIN$, $B2MAX$,
c2b, c2bIndex);
c2bInitialized = true;
}
}
}