sun.io
Class ByteToCharDBCS_ASCII

java.lang.Object
  extended by sun.io.ByteToCharConverter
      extended by sun.io.ByteToCharDBCS_ASCII
Direct Known Subclasses:
ByteToCharCp1381, ByteToCharCp942, ByteToCharCp942C, ByteToCharCp943, ByteToCharCp943C, ByteToCharCp948, ByteToCharCp949, ByteToCharCp949C, ByteToCharCp950

public abstract class ByteToCharDBCS_ASCII
extends ByteToCharConverter


Field Summary
protected  short[] index1
           
protected  String index2
           
protected  boolean[] leadByte
           
protected  int mask1
           
protected  int mask2
           
protected  int shift
           
protected  String singleByteToChar
           
 
Fields inherited from class sun.io.ByteToCharConverter
badInputLength, byteOff, charOff, subChars, subMode
 
Constructor Summary
ByteToCharDBCS_ASCII()
           
 
Method Summary
 int convert(byte[] input, int inOff, int inEnd, char[] output, int outOff, int outEnd)
          Character conversion
 int flush(char[] output, int outStart, int outEnd)
          Writes any remaining output to the output buffer and resets the converter to its initial state.
 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

singleByteToChar

protected String singleByteToChar

leadByte

protected boolean[] leadByte

index1

protected short[] index1

index2

protected String index2

mask1

protected int mask1

mask2

protected int mask2

shift

protected int shift
Constructor Detail

ByteToCharDBCS_ASCII

public ByteToCharDBCS_ASCII()
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
Character conversion

Specified by:
convert in class ByteToCharConverter
Parameters:
input - byte array containing text to be converted.
inOff - begin conversion at this offset in input array.
inEnd - stop conversion at this offset in input array (exclusive).
output - character array to receive conversion result.
outOff - start writing to output array at this offset.
outEnd - stop writing to output array at this offset (exclusive).
Returns:
the number of bytes 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.

Specified by:
reset in class ByteToCharConverter