sun.io
Class ByteToCharSingleByte

java.lang.Object
  extended by sun.io.ByteToCharConverter
      extended by sun.io.ByteToCharSingleByte
Direct Known Subclasses:
ByteToCharCp037, ByteToCharCp1006, ByteToCharCp1025, ByteToCharCp1026, ByteToCharCp1046, ByteToCharCp1097, ByteToCharCp1098, ByteToCharCp1112, ByteToCharCp1122, ByteToCharCp1123, ByteToCharCp1124, ByteToCharCp1140, ByteToCharCp1141, ByteToCharCp1142, ByteToCharCp1143, ByteToCharCp1144, ByteToCharCp1145, ByteToCharCp1146, ByteToCharCp1147, ByteToCharCp1148, ByteToCharCp1149, ByteToCharCp1250, ByteToCharCp1251, ByteToCharCp1252, ByteToCharCp1253, ByteToCharCp1254, ByteToCharCp1255, ByteToCharCp1256, ByteToCharCp1257, ByteToCharCp1258, ByteToCharCp273, ByteToCharCp277, ByteToCharCp278, ByteToCharCp280, ByteToCharCp284, ByteToCharCp285, ByteToCharCp297, ByteToCharCp420, ByteToCharCp424, ByteToCharCp437, ByteToCharCp500, ByteToCharCp737, ByteToCharCp775, ByteToCharCp838, ByteToCharCp850, ByteToCharCp852, ByteToCharCp855, ByteToCharCp856, ByteToCharCp857, ByteToCharCp858, ByteToCharCp860, ByteToCharCp861, ByteToCharCp862, ByteToCharCp863, ByteToCharCp864, ByteToCharCp865, ByteToCharCp866, ByteToCharCp868, ByteToCharCp869, ByteToCharCp870, ByteToCharCp871, ByteToCharCp874, ByteToCharCp875, ByteToCharCp918, ByteToCharCp921, ByteToCharCp922, ByteToCharCp923, ByteToCharISO8859_15_FDIS, ByteToCharISO8859_2, ByteToCharISO8859_3, ByteToCharISO8859_4, ByteToCharISO8859_5, ByteToCharISO8859_6, ByteToCharISO8859_7, ByteToCharISO8859_8, ByteToCharISO8859_9, ByteToCharKOI8_R, ByteToCharMacArabic, ByteToCharMacCentralEurope, ByteToCharMacCroatian, ByteToCharMacCyrillic, ByteToCharMacDingbat, ByteToCharMacGreek, ByteToCharMacHebrew, ByteToCharMacIceland, ByteToCharMacRoman, ByteToCharMacRomania, ByteToCharMacSymbol, ByteToCharMacThai, ByteToCharMacTurkish, ByteToCharMacUkraine, ByteToCharMS874, ByteToCharTIS620

public abstract class ByteToCharSingleByte
extends ByteToCharConverter

A table driven conversion from byte to char for single byte character sets. The needed data tables will reside in a character set specific subclass.


Field Summary
protected  String byteToCharTable
          Mapping table.
 
Fields inherited from class sun.io.ByteToCharConverter
badInputLength, byteOff, charOff, subChars, subMode
 
Constructor Summary
ByteToCharSingleByte()
           
 
Method Summary
 int convert(byte[] input, int inOff, int inEnd, char[] output, int outOff, int outEnd)
          Converts bytes to characters according to the selected character encoding.
 int flush(char[] output, int outStart, int outEnd)
          Writes any remaining output to the output buffer and resets the converter to its initial state.
 String getByteToCharTable()
           
protected  char getUnicode(int byteIndex)
           
 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

byteToCharTable

protected String byteToCharTable
Mapping table. Values supplied by subclass

Constructor Detail

ByteToCharSingleByte

public ByteToCharSingleByte()
Method Detail

getByteToCharTable

public String getByteToCharTable()

flush

public int flush(char[] output,
                 int outStart,
                 int outEnd)
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).

convert

public int convert(byte[] input,
                   int inOff,
                   int inEnd,
                   char[] output,
                   int outOff,
                   int outEnd)
            throws UnknownCharacterException,
                   MalformedInputException,
                   ConversionBufferFullException
Converts bytes to characters according to the selected character encoding. Maintains internal state, so that conversions that result in exceptions can be restarted by calling convert again, with appropriately modified parameters. Call reset before converting input that is not a continuation of the previous call.

Specified by:
convert in class ByteToCharConverter
Parameters:
input - byte array containing text in character set
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 character to be written to
Returns:
the number of 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.
See Also:
reset()

getUnicode

protected char getUnicode(int byteIndex)

reset

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

Specified by:
reset in class ByteToCharConverter