--- a/jdk/src/share/classes/sun/io/CharToByteMS932.java Fri Jun 19 14:12:22 2009 +0200
+++ b/jdk/src/share/classes/sun/io/CharToByteMS932.java Fri Jun 19 14:39:06 2009 -0700
@@ -25,32 +25,18 @@
package sun.io;
-/**
- * Tables and data to convert Unicode to MS932
- *
- * @author ConverterGenerator tool
- */
+import sun.nio.cs.ext.*;
-public class CharToByteMS932 extends CharToByteMS932DB {
- CharToByteJIS0201 cbJIS0201 = new CharToByteJIS0201();
+public class CharToByteMS932 extends CharToByteDBCS_ASCII {
+
+ private static DoubleByte.Encoder enc =
+ (DoubleByte.Encoder)new MS932().newEncoder();
public String getCharacterEncoding() {
return "MS932";
}
- protected int convSingleByte(char inputChar, byte[] outputByte) {
- byte b;
-
- // \u0000 - \u007F map straight through
- if ((inputChar &0xFF80) == 0) {
- outputByte[0] = (byte)inputChar;
- return 1;
- }
-
- if ((b = cbJIS0201.getNative(inputChar)) == 0)
- return 0;
-
- outputByte[0] = b;
- return 1;
+ public CharToByteMS932() {
+ super(enc);
}
}