src/share/classes/sun/nio/cs/ext/DoubleByte.java

Print this page

        

*** 247,261 **** public char decodeSingle(int b) { return b2cSB[b]; } public char decodeDouble(int b1, int b2) { ! if (b2 < b2Min || b2 > b2Max) return UNMAPPABLE_DECODING; return b2c[b1][b2 - b2Min]; } - } // IBM_EBCDIC_DBCS public static class Decoder_EBCDIC extends Decoder { private static final int SBCS = 0; --- 247,261 ---- public char decodeSingle(int b) { return b2cSB[b]; } public char decodeDouble(int b1, int b2) { ! if (b1 < 0 || b1 > b2c.length || ! b2 < b2Min || b2 > b2Max) return UNMAPPABLE_DECODING; return b2c[b1][b2 - b2Min]; } } // IBM_EBCDIC_DBCS public static class Decoder_EBCDIC extends Decoder { private static final int SBCS = 0;
*** 433,451 **** } return dp; } } ! // EBCDIC_DBCS_ONLY ! public static class Decoder_EBCDIC_DBCSONLY extends Decoder { ! static final char[] b2cSB; static { ! b2cSB = new char[0x100]; ! Arrays.fill(b2cSB, UNMAPPABLE_DECODING); } ! Decoder_EBCDIC_DBCSONLY(Charset cs, char[][] b2c, int b2Min, int b2Max) { ! super(cs, 0.5f, 1.0f, b2c, b2cSB, b2Min, b2Max); } } // EUC_SIMPLE // The only thing we need to "override" is to check SS2/SS3 and --- 433,451 ---- } return dp; } } ! // DBCS_ONLY ! public static class Decoder_DBCSONLY extends Decoder { ! static final char[] b2cSB_UNMAPPABLE; static { ! b2cSB_UNMAPPABLE = new char[0x100]; ! Arrays.fill(b2cSB_UNMAPPABLE, UNMAPPABLE_DECODING); } ! Decoder_DBCSONLY(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) { ! super(cs, 0.5f, 1.0f, b2c, b2cSB_UNMAPPABLE, b2Min, b2Max); } } // EUC_SIMPLE // The only thing we need to "override" is to check SS2/SS3 and
*** 725,736 **** } } } } ! public static class Encoder_EBCDIC_DBCSONLY extends Encoder { ! Encoder_EBCDIC_DBCSONLY(Charset cs, byte[] repl, char[] c2b, char[] c2bIndex) { super(cs, 2.0f, 2.0f, repl, c2b, c2bIndex); } public int encodeChar(char ch) { --- 725,736 ---- } } } } ! public static class Encoder_DBCSONLY extends Encoder { ! Encoder_DBCSONLY(Charset cs, byte[] repl, char[] c2b, char[] c2bIndex) { super(cs, 2.0f, 2.0f, repl, c2b, c2bIndex); } public int encodeChar(char ch) {
*** 739,748 **** --- 739,750 ---- return UNMAPPABLE_ENCODING; return bb; } } + + public static class Encoder_EBCDIC extends Encoder { static final int SBCS = 0; static final int DBCS = 1; static final byte SO = 0x0e; static final byte SI = 0x0f;
*** 909,914 **** --- 911,917 ---- public static class Encoder_EUC_SIM extends Encoder { Encoder_EUC_SIM(Charset cs, char[] c2b, char[] c2bIndex) { super(cs, c2b, c2bIndex); } } + }