jdk/src/share/classes/sun/io/ByteToCharCp942C.java
changeset 2921 d9d491a5a169
parent 2 90ce3da70b43
child 5506 202f599c92aa
--- a/jdk/src/share/classes/sun/io/ByteToCharCp942C.java	Wed May 20 13:55:50 2009 -0700
+++ b/jdk/src/share/classes/sun/io/ByteToCharCp942C.java	Thu May 21 23:32:46 2009 -0700
@@ -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;
 
-      /* 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";
-   }
+    // Return the character set id
+    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());
+    }
 }