--- old/src/share/classes/sun/io/ByteToCharCp942C.java Wed May 20 18:58:38 2009 +++ new/src/share/classes/sun/io/ByteToCharCp942C.java Wed May 20 18:58:37 2009 @@ -25,44 +25,16 @@ package sun.io; -import sun.io.*; +import sun.nio.cs.ext.*; public class ByteToCharCp942C extends ByteToCharDBCS_ASCII { - protected static final String singleByteToChar; - protected static final boolean leadByte[]; - protected static final short index1[]; - protected static final String index2; - protected static final int mask1; - protected static final int mask2; - protected static final int shift; - static { - ByteToCharDBCS_ASCII y = new ByteToCharCp942(); - mask1 = y.mask1; - mask2 = y.mask2; - shift = y.shift; - leadByte = y.leadByte; - index1 = y.index1; - index2 = y.index2; + // Return the character set id + public String getCharacterEncoding() { + return "Cp942C"; + } - /* Fix converter to pass through 0x00 to 0x7f unchanged to U+0000 to U+007F */ - String indexs = ""; - for (char c = '\0'; c < '\u0080'; ++c) indexs += c; - singleByteToChar = indexs + y.singleByteToChar.substring(indexs.length()); - } - - public String getCharacterEncoding() { - return "Cp942C"; - } - - ByteToCharCp942C() { - super(); - super.mask1 = mask1; - super.mask2 = mask2; - super.shift = shift; - super.leadByte = leadByte; - super.singleByteToChar = singleByteToChar; - super.index1 = index1; - super.index2 = index2; - } + public ByteToCharCp942C() { + super((DoubleByte.Decoder)new IBM942C().newDecoder()); + } }