sun.io
Class ByteToCharDBCS_ASCII
java.lang.Object
sun.io.ByteToCharConverter
sun.io.ByteToCharDBCS_ASCII
- Direct Known Subclasses:
- ByteToCharCp1381, ByteToCharCp942, ByteToCharCp942C, ByteToCharCp943, ByteToCharCp943C, ByteToCharCp948, ByteToCharCp949, ByteToCharCp949C, ByteToCharCp950
public abstract class ByteToCharDBCS_ASCII
- extends ByteToCharConverter
|
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 |
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
ByteToCharDBCS_ASCII
public ByteToCharDBCS_ASCII()
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