sun.io
Class ByteToCharDoubleByte

java.lang.Object
  extended by sun.io.ByteToCharConverter
      extended by sun.io.ByteToCharDoubleByte
Direct Known Subclasses:
ByteToCharBig5, ByteToCharEUC_CN, ByteToCharEUC_JP, ByteToCharEUC_KR, ByteToCharGBK, ByteToCharISO2022JP, ByteToCharJohab, ByteToCharSJIS

public abstract class ByteToCharDoubleByte
extends ByteToCharConverter


Field Summary
protected  int badInputLength
           
protected  int end
           
protected  short[] index1
           
protected  String[] index2
           
protected static char REPLACE_CHAR
           
protected  byte savedByte
           
protected  int start
           
 
Fields inherited from class sun.io.ByteToCharConverter
byteOff, charOff, subChars, subMode
 
Constructor Summary
ByteToCharDoubleByte()
           
 
Method Summary
 int convert(byte[] input, int inOff, int inEnd, char[] output, int outOff, int outEnd)
          Converts sequences of bytes to characters.
protected  char convSingleByte(int b)
           
 int flush(char[] output, int outStart, int outEnd)
          Writes any remaining output to the output buffer and resets the converter to its initial state.
protected  char getUnicode(int byte1, int byte2)
           
 void reset()
          Resets the converter.
 
Methods inherited from class sun.io.ByteToCharConverter
convertAll, getBadInputLength, getCharacterEncoding, getConverter, getDefault, getMaxCharsPerByte, nextByteIndex, nextCharIndex, setSubstitutionChars, setSubstitutionMode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

savedByte

protected byte savedByte

index1

protected short[] index1

index2

protected String[] index2

start

protected int start

end

protected int end

badInputLength

protected int badInputLength

REPLACE_CHAR

protected static final char REPLACE_CHAR
See Also:
Constant Field Values
Constructor Detail

ByteToCharDoubleByte

public ByteToCharDoubleByte()
Method Detail

flush

public int flush(char[] output,
                 int outStart,
                 int outEnd)
          throws MalformedInputException
Description copied from class: ByteToCharConverter
Writes any remaining output to the output buffer and resets the converter to its initial state.

Specified by:
flush in class ByteToCharConverter
Parameters:
output - char array to receive flushed output.
outStart - start writing to output array at this offset.
outEnd - stop writing to output array at this offset (exclusive).
Throws:
MalformedInputException - if the output to be flushed contained a partial or invalid multibyte character sequence. flush will write what it can to the output buffer and reset the converter before throwing this exception. An additional call to flush is not required.

convert

public int convert(byte[] input,
                   int inOff,
                   int inEnd,
                   char[] output,
                   int outOff,
                   int outEnd)
            throws UnknownCharacterException,
                   MalformedInputException,
                   ConversionBufferFullException
Converts sequences of bytes to characters. Conversions that result in Exceptions can be restarted by calling convert again, with appropriately modified parameters.

Specified by:
convert in class ByteToCharConverter
Parameters:
input - byte array containing text in Double/single Byte
inStart - offset in input array
inEnd - offset of last byte to be converted
output - character array to receive conversion result
outStart - starting offset
outEnd - offset of last byte to be written to
Returns:
the characters written to output.
Throws:
UnknownCharacterException - for any character that that cannot be converted to Unicode. Thrown only when converter is not in substitution mode.
MalformedInputException - if the input buffer contains any sequence of bytes that is illegal for the input character set.
ConversionBufferFullException - if output array is filled prior to converting all the input.

reset

public void reset()
Resets the converter. Call this method to reset the converter to its initial state

Specified by:
reset in class ByteToCharConverter

convSingleByte

protected char convSingleByte(int b)

getUnicode

protected char getUnicode(int byte1,
                          int byte2)