sun.io
Class ByteToCharUTF8

java.lang.Object
  extended by sun.io.ByteToCharConverter
      extended by sun.io.ByteToCharUTF8

public class ByteToCharUTF8
extends ByteToCharConverter

UCS Transformation Format 8 (UTF-8) -> UCS2 (UTF16) converter see CharToByteUTF8.java about UTF-8 format


Field Summary
 
Fields inherited from class sun.io.ByteToCharConverter
badInputLength, byteOff, charOff, subChars, subMode
 
Constructor Summary
ByteToCharUTF8()
           
 
Method Summary
 int convert(byte[] input, int inOff, int inEnd, char[] output, int outOff, int outEnd)
          Character converson
 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 getCharacterEncoding()
          Returns the character set id for the conversion
 void reset()
          Resets converter to its initial state.
 
Methods inherited from class sun.io.ByteToCharConverter
convertAll, getBadInputLength, 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
 

Constructor Detail

ByteToCharUTF8

public ByteToCharUTF8()
Method Detail

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 MalformedInputException,
                   ConversionBufferFullException
Character converson

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:
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.

getCharacterEncoding

public String getCharacterEncoding()
Description copied from class: ByteToCharConverter
Returns the character set id for the conversion

Specified by:
getCharacterEncoding in class ByteToCharConverter

reset

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

Specified by:
reset in class ByteToCharConverter