2009-05-22 06:32:46 +00:00
|
|
|
/*
|
2013-12-26 20:04:16 +00:00
|
|
|
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
2009-05-22 06:32:46 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
2010-05-25 22:58:33 +00:00
|
|
|
* published by the Free Software Foundation. Oracle designates this
|
2009-05-22 06:32:46 +00:00
|
|
|
* particular file as subject to the "Classpath" exception as provided
|
2010-05-25 22:58:33 +00:00
|
|
|
* by Oracle in the LICENSE file that accompanied this code.
|
2009-05-22 06:32:46 +00:00
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2010-05-25 22:58:33 +00:00
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
2009-05-22 06:32:46 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
// -- This file was mechanically generated: Do not edit! -- //
|
|
|
|
|
|
|
|
package $PACKAGE$;
|
|
|
|
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
import java.nio.charset.CharsetDecoder;
|
|
|
|
import java.nio.charset.CharsetEncoder;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import sun.nio.cs.HistoricallyNamedCharset;
|
2015-02-16 22:53:59 +00:00
|
|
|
import sun.nio.cs.DoubleByte;
|
|
|
|
import sun.nio.cs.*;
|
2009-05-22 06:32:46 +00:00
|
|
|
|
|
|
|
public class $NAME_CLZ$ extends Charset
|
|
|
|
$IMPLEMENTS$
|
|
|
|
{
|
|
|
|
public $NAME_CLZ$() {
|
|
|
|
super("$NAME_CS$", $NAME_ALIASES$);
|
|
|
|
}
|
|
|
|
|
|
|
|
$HISTORICALNAME$
|
|
|
|
|
|
|
|
public boolean contains(Charset cs) {
|
|
|
|
$CONTAINS$
|
|
|
|
}
|
|
|
|
|
|
|
|
public CharsetDecoder newDecoder() {
|
|
|
|
initb2c();
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 08:42:11 +00:00
|
|
|
return new DoubleByte.Decoder$DECTYPE$(this, b2c, b2cSB, $B2MIN$, $B2MAX$, $ASCIICOMPATIBLE$);
|
2009-05-22 06:32:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public CharsetEncoder newEncoder() {
|
|
|
|
initc2b();
|
8141132: JEP 254: Compact Strings
Adopt a more space-efficient internal representation for strings.
Co-authored-by: Brent Christian <brent.christian@oracle.com>
Co-authored-by: Vivek Deshpande <vivek.r.deshpande@intel.com>
Co-authored-by: Charlie Hunt <charlie.hunt@oracle.com>
Co-authored-by: Vladimir Kozlov <vladimir.kozlov@oracle.com>
Co-authored-by: Roger Riggs <roger.riggs@oracle.com>
Co-authored-by: Xueming Shen <xueming.shen@oracle.com>
Co-authored-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
Co-authored-by: Sandhya Viswanathan <sandhya.viswanathan@intel.com>
Reviewed-by: alanb, bdelsart, coleenp, iklam, jiangli, jrose, kevinw, naoto, pliden, roland, smarks, twisti
2015-11-03 08:42:11 +00:00
|
|
|
return new DoubleByte.Encoder$ENCTYPE$(this, $ENC_REPLACEMENT$ c2b, c2bIndex, $ASCIICOMPATIBLE$);
|
2009-05-22 06:32:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|