sun.io
Class ByteToCharDoubleByte
java.lang.Object
sun.io.ByteToCharConverter
sun.io.ByteToCharDoubleByte
- Direct Known Subclasses:
- ByteToCharBig5, ByteToCharEUC_CN, ByteToCharEUC_JP, ByteToCharEUC_KR, ByteToCharGBK, ByteToCharISO2022JP, ByteToCharJohab, ByteToCharSJIS
public abstract class ByteToCharDoubleByte
- extends ByteToCharConverter
|
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 |
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
ByteToCharDoubleByte
public ByteToCharDoubleByte()
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 ByteinStart - offset in input arrayinEnd - offset of last byte to be convertedoutput - character array to receive conversion resultoutStart - starting offsetoutEnd - 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)