sun.io
Class ByteToCharISO2022

java.lang.Object
  extended by sun.io.ByteToCharConverter
      extended by sun.io.ByteToCharISO2022
Direct Known Subclasses:
ByteToCharISO2022CN, ByteToCharISO2022KR

public abstract class ByteToCharISO2022
extends ByteToCharConverter

An algorithmic conversion from ISO 2022 to Unicode


Field Summary
protected  ByteToCharConverter[] SOConverter
           
protected  String[] SODesignator
           
protected  ByteToCharConverter[] SS2Converter
           
protected  String[] SS2Designator
           
protected  ByteToCharConverter[] SS3Converter
           
protected  String[] SS3Designator
           
 
Fields inherited from class sun.io.ByteToCharConverter
badInputLength, byteOff, charOff, subChars, subMode
 
Constructor Summary
ByteToCharISO2022()
           
 
Method Summary
 int convert(byte[] input, int inOff, int inEnd, char[] output, int outOff, int outEnd)
          Converts an array of bytes containing characters in an external encoding into an array of Unicode characters.
 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 converter to its initial state.
 
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

SODesignator

protected String[] SODesignator

SS2Designator

protected String[] SS2Designator

SS3Designator

protected String[] SS3Designator

SOConverter

protected ByteToCharConverter[] SOConverter

SS2Converter

protected ByteToCharConverter[] SS2Converter

SS3Converter

protected ByteToCharConverter[] SS3Converter
Constructor Detail

ByteToCharISO2022

public ByteToCharISO2022()
Method Detail

reset

public void reset()
Description copied from class: ByteToCharConverter
Resets converter to its initial state.

Specified by:
reset in class ByteToCharConverter

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 final int convert(byte[] input,
                         int inOff,
                         int inEnd,
                         char[] output,
                         int outOff,
                         int outEnd)
                  throws ConversionBufferFullException
Description copied from class: ByteToCharConverter
Converts an array of bytes containing characters in an external encoding into an array of Unicode characters. This method allows a buffer by buffer conversion of a data stream. The state of the conversion is saved between calls to convert. Among other things, this means multibyte input sequences can be split between calls. If a call to convert results in an exception, the conversion may be continued by calling convert again with suitably modified parameters. All conversions should be finished with a call to the flush method.

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:
ConversionBufferFullException - if output array is filled prior to converting all the input.