jdk

Форк
0
/
DoubleByte-X.java.template 
88 строк · 3.1 Кб
1
/*
2
 * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved.
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
7
 * published by the Free Software Foundation.  Oracle designates this
8
 * particular file as subject to the "Classpath" exception as provided
9
 * by Oracle in the LICENSE file that accompanied this code.
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
 *
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
// -- 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;
35
import sun.nio.cs.DoubleByte;
36
import sun.nio.cs.*;
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
        return new DoubleByte.Decoder$DECTYPE$(this, DecodeHolder.b2c, DecodeHolder.b2cSB, $B2MIN$, $B2MAX$, $ASCIICOMPATIBLE$);
53
    }
54

55
    public CharsetEncoder newEncoder() {
56
        return new DoubleByte.Encoder$ENCTYPE$(this, $ENC_REPLACEMENT$ EncodeHolder.c2b, EncodeHolder.c2bIndex, $ASCIICOMPATIBLE$);
57
    }
58

59
    public static class DecodeHolder {
60
        $B2C$
61
        public static final char[][] b2c = new char[b2cStr.length][];
62
        public static final char[] b2cSB;
63

64
        static {
65
            for (int i = 0; i < b2cStr.length; i++) {
66
                if (b2cStr[i] == null)
67
                    b2c[i] = DoubleByte.B2C_UNMAPPABLE;
68
                else
69
                    b2c[i] = b2cStr[i].toCharArray();
70
            }
71
            b2cSB = b2cSBStr.toCharArray();
72
        }
73
    }
74

75
    public static class EncodeHolder {
76
        public static final char[] c2b = new char[$C2BLENGTH$];
77
        public static final char[] c2bIndex = new char[0x100];
78

79
        static {
80
            $NONROUNDTRIP_B2C$
81
            $NONROUNDTRIP_C2B$
82
            DoubleByte.Encoder.initC2B(DecodeHolder.b2cStr, DecodeHolder.b2cSBStr,
83
                                       b2cNR, c2bNR,
84
                                       $B2MIN$, $B2MAX$,
85
                                       c2b, c2bIndex);
86
        }
87
    }
88
}
89

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.