src/java.base/share/classes/sun/nio/cs/DoubleByte.java
Print this page
@@ -21,11 +21,11 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package sun.nio.cs.ext;
+package sun.nio.cs;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
@@ -128,21 +128,21 @@
return CoderResult.malformedForLength(1);
}
return CoderResult.unmappableForLength(2);
}
- Decoder(Charset cs, float avgcpb, float maxcpb,
+ public Decoder(Charset cs, float avgcpb, float maxcpb,
char[][] b2c, char[] b2cSB,
int b2Min, int b2Max) {
super(cs, avgcpb, maxcpb);
this.b2c = b2c;
this.b2cSB = b2cSB;
this.b2Min = b2Min;
this.b2Max = b2Max;
}
- Decoder(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
+ public Decoder(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
this(cs, 0.5f, 1.0f, b2c, b2cSB, b2Min, b2Max);
}
protected CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
byte[] sa = src.array();
@@ -271,11 +271,11 @@
private static final int DBCS = 1;
private static final int SO = 0x0e;
private static final int SI = 0x0f;
private int currentState;
- Decoder_EBCDIC(Charset cs,
+ public Decoder_EBCDIC(Charset cs,
char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
super(cs, b2c, b2cSB, b2Min, b2Max);
}
public void implReset() {
@@ -449,11 +449,11 @@
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) {
+ public 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
@@ -461,11 +461,11 @@
// return "malformed" if found
public static class Decoder_EUC_SIM extends Decoder {
private final int SS2 = 0x8E;
private final int SS3 = 0x8F;
- Decoder_EUC_SIM(Charset cs,
+ public Decoder_EUC_SIM(Charset cs,
char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
super(cs, b2c, b2cSB, b2Min, b2Max);
}
// No support provided for G2/G3 for SimpleEUC
@@ -509,32 +509,32 @@
}
public static class Encoder extends CharsetEncoder
implements ArrayEncoder
{
- final int MAX_SINGLEBYTE = 0xff;
+ protected final int MAX_SINGLEBYTE = 0xff;
private final char[] c2b;
private final char[] c2bIndex;
- Surrogate.Parser sgp;
+ protected Surrogate.Parser sgp;
- protected Encoder(Charset cs, char[] c2b, char[] c2bIndex) {
+ public Encoder(Charset cs, char[] c2b, char[] c2bIndex) {
super(cs, 2.0f, 2.0f);
this.c2b = c2b;
this.c2bIndex = c2bIndex;
}
- Encoder(Charset cs, float avg, float max, byte[] repl, char[] c2b, char[] c2bIndex) {
+ public Encoder(Charset cs, float avg, float max, byte[] repl, char[] c2b, char[] c2bIndex) {
super(cs, avg, max, repl);
this.c2b = c2b;
this.c2bIndex = c2bIndex;
}
public boolean canEncode(char c) {
return encodeChar(c) != UNMAPPABLE_ENCODING;
}
- Surrogate.Parser sgp() {
+ protected Surrogate.Parser sgp() {
if (sgp == null)
sgp = new Surrogate.Parser();
return sgp;
}
@@ -655,11 +655,11 @@
public int encodeChar(char ch) {
return c2b[c2bIndex[ch >> 8] + (ch & 0xff)];
}
// init the c2b and c2bIndex tables from b2c.
- static void initC2B(String[] b2c, String b2cSB, String b2cNR, String c2bNR,
+ public static void initC2B(String[] b2c, String b2cSB, String b2cNR, String c2bNR,
int b2Min, int b2Max,
char[] c2b, char[] c2bIndex)
{
Arrays.fill(c2b, (char)UNMAPPABLE_ENCODING);
int off = 0x100;
@@ -739,11 +739,11 @@
}
}
}
public static class Encoder_DBCSONLY extends Encoder {
- Encoder_DBCSONLY(Charset cs, byte[] repl,
+ public Encoder_DBCSONLY(Charset cs, byte[] repl,
char[] c2b, char[] c2bIndex) {
super(cs, 2.0f, 2.0f, repl, c2b, c2bIndex);
}
public int encodeChar(char ch) {
@@ -762,11 +762,11 @@
static final byte SO = 0x0e;
static final byte SI = 0x0f;
protected int currentState = SBCS;
- Encoder_EBCDIC(Charset cs, char[] c2b, char[] c2bIndex) {
+ public Encoder_EBCDIC(Charset cs, char[] c2b, char[] c2bIndex) {
super(cs, 4.0f, 5.0f, new byte[] {(byte)0x6f}, c2b, c2bIndex);
}
protected void implReset() {
currentState = SBCS;
@@ -919,11 +919,11 @@
}
}
// EUC_SIMPLE
public static class Encoder_EUC_SIM extends Encoder {
- Encoder_EUC_SIM(Charset cs, char[] c2b, char[] c2bIndex) {
+ public Encoder_EUC_SIM(Charset cs, char[] c2b, char[] c2bIndex) {
super(cs, c2b, c2bIndex);
}
}
}