sun.io
Class ByteToCharSingleByte
java.lang.Object
sun.io.ByteToCharConverter
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.
|
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 |
byteToCharTable
protected String byteToCharTable
- Mapping table. Values supplied by subclass
ByteToCharSingleByte
public ByteToCharSingleByte()
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 setinStart - offset in input arrayinEnd - offset of last byte to be convertedoutput - character array to receive conversion resultoutStart - starting offsetoutEnd - 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