aboutsummaryrefslogtreecommitdiff
path: root/src/share/classes/sun/io/ByteToCharJISAutoDetect.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/classes/sun/io/ByteToCharJISAutoDetect.java')
-rw-r--r--src/share/classes/sun/io/ByteToCharJISAutoDetect.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/share/classes/sun/io/ByteToCharJISAutoDetect.java b/src/share/classes/sun/io/ByteToCharJISAutoDetect.java
index 97a0e8828..8f00ef6c2 100644
--- a/src/share/classes/sun/io/ByteToCharJISAutoDetect.java
+++ b/src/share/classes/sun/io/ByteToCharJISAutoDetect.java
@@ -34,14 +34,12 @@ public class ByteToCharJISAutoDetect extends ByteToCharConverter {
private final static int SJIS1B_MASK = 0x04;
private final static int EUCJP_KANA1_MASK = 0x08;
private final static int EUCJP_KANA2_MASK = 0x10;
- private static byte[] maskTable1;
- private static byte[] maskTable2;
+ private final static byte[] maskTable1 = JISAutoDetect.getByteMask1();
+ private final static byte[] maskTable2 = JISAutoDetect.getByteMask2();
private final static int SS2 = 0x8e;
private final static int SS3 = 0x8f;
- private final static JISAutoDetect nioCoder = new JISAutoDetect();
-
// SJISName is set to either "SJIS" or "MS932"
private String SJISName;
private String EUCJPName;
@@ -57,8 +55,6 @@ public class ByteToCharJISAutoDetect extends ByteToCharConverter {
defaultConv = new ByteToCharISO8859_1();
defaultConv.subChars = subChars;
defaultConv.subMode = subMode;
- maskTable1 = nioCoder.getByteMask1();
- maskTable2 = nioCoder.getByteMask2();
}
public int flush(char [] output, int outStart, int outEnd)
@@ -133,7 +129,7 @@ public class ByteToCharJISAutoDetect extends ByteToCharConverter {
break;
}
if ((mask == SJIS2B_MASK) || (mask == SJIS1B_MASK)
- || (nioCoder.canBeSJIS1B(firstmask) && secondmask == 0)) {
+ || (JISAutoDetect.canBeSJIS1B(firstmask) && secondmask == 0)) {
convName = SJISName;
break;
}
@@ -145,15 +141,15 @@ public class ByteToCharJISAutoDetect extends ByteToCharConverter {
// character boundary. If we tried both
// possibilities here, it might be able to be
// determined correctly.
- if ((byte1 == SS3) && nioCoder.canBeEUCJP(secondmask)) {
+ if ((byte1 == SS3) && JISAutoDetect.canBeEUCJP(secondmask)) {
if (cnt+1 < inEnd) {
int nextbyte = input[cnt+1] & 0xff;
- if (! nioCoder.canBeEUCJP(maskTable2[nextbyte]))
+ if (! JISAutoDetect.canBeEUCJP(maskTable2[nextbyte]))
convName = SJISName;
} else
convName = SJISName;
}
- if (nioCoder.canBeEUCKana(firstmask, secondmask))
+ if (JISAutoDetect.canBeEUCKana(firstmask, secondmask))
euckana++;
} else {
if ((firstmask & SJIS1B_MASK) != 0) {