author | roland |
Sat, 02 Dec 2017 13:50:04 +0100 | |
changeset 48298 | 40b9faefb496 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
2921 | 1 |
/* |
23010
6dadb192ad81
8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents:
21805
diff
changeset
|
2 |
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. |
2921 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2921 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2921 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
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 |
* |
|
5506 | 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. |
|
2921 | 24 |
*/ |
25 |
||
26 |
// -- This file was mechanically generated: Do not edit! -- // |
|
27 |
||
28 |
package $PACKAGE$; |
|
29 |
||
30 |
import java.nio.charset.Charset; |
|
31 |
import java.nio.charset.CharsetDecoder; |
|
32 |
import java.nio.charset.CharsetEncoder; |
|
33 |
import java.util.Arrays; |
|
34 |
import sun.nio.cs.HistoricallyNamedCharset; |
|
28969
f980bee32887
8073152: Update Standard/ExtendedCharsets to work with module system
sherman
parents:
23010
diff
changeset
|
35 |
import sun.nio.cs.DoubleByte; |
f980bee32887
8073152: Update Standard/ExtendedCharsets to work with module system
sherman
parents:
23010
diff
changeset
|
36 |
import sun.nio.cs.*; |
2921 | 37 |
|
38 |
public class $NAME_CLZ$ extends Charset |
|
39 |
$IMPLEMENTS$ |
|
40 |
{ |
|
41 |
public $NAME_CLZ$() { |
|
42 |
super("$NAME_CS$", $NAME_ALIASES$); |
|
43 |
} |
|
44 |
||
45 |
$HISTORICALNAME$ |
|
46 |
||
47 |
public boolean contains(Charset cs) { |
|
48 |
$CONTAINS$ |
|
49 |
} |
|
50 |
||
51 |
public CharsetDecoder newDecoder() { |
|
52 |
initb2c(); |
|
33663 | 53 |
return new DoubleByte.Decoder$DECTYPE$(this, b2c, b2cSB, $B2MIN$, $B2MAX$, $ASCIICOMPATIBLE$); |
2921 | 54 |
} |
55 |
||
56 |
public CharsetEncoder newEncoder() { |
|
57 |
initc2b(); |
|
33663 | 58 |
return new DoubleByte.Encoder$ENCTYPE$(this, $ENC_REPLACEMENT$ c2b, c2bIndex, $ASCIICOMPATIBLE$); |
2921 | 59 |
} |
60 |
||
61 |
$B2C$ |
|
62 |
static char[][] b2c = new char[b2cStr.length][]; |
|
63 |
static char[] b2cSB; |
|
64 |
private static volatile boolean b2cInitialized = false; |
|
65 |
||
66 |
static void initb2c() { |
|
67 |
if (b2cInitialized) |
|
68 |
return; |
|
69 |
synchronized (b2c) { |
|
70 |
if (b2cInitialized) |
|
71 |
return; |
|
72 |
for (int i = 0; i < b2cStr.length; i++) { |
|
73 |
if (b2cStr[i] == null) |
|
74 |
b2c[i] = DoubleByte.B2C_UNMAPPABLE; |
|
75 |
else |
|
76 |
b2c[i] = b2cStr[i].toCharArray(); |
|
77 |
} |
|
78 |
b2cSB = b2cSBStr.toCharArray(); |
|
79 |
b2cInitialized = true; |
|
80 |
} |
|
81 |
} |
|
82 |
||
83 |
static char[] c2b = new char[$C2BLENGTH$]; |
|
84 |
static char[] c2bIndex = new char[0x100]; |
|
85 |
private static volatile boolean c2bInitialized = false; |
|
86 |
||
87 |
static void initc2b() { |
|
88 |
if (c2bInitialized) |
|
89 |
return; |
|
90 |
synchronized (c2b) { |
|
91 |
if (c2bInitialized) |
|
92 |
return; |
|
93 |
$NONROUNDTRIP_B2C$ |
|
94 |
$NONROUNDTRIP_C2B$ |
|
95 |
DoubleByte.Encoder.initC2B(b2cStr, b2cSBStr, b2cNR, c2bNR, |
|
96 |
$B2MIN$, $B2MAX$, |
|
97 |
c2b, c2bIndex); |
|
98 |
c2bInitialized = true; |
|
99 |
} |
|
100 |
} |
|
101 |
} |