All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.io.CharToByteUTF8

java.lang.Object
   |
   +----sun.io.CharToByteConverter
           |
           +----sun.io.CharToByteUTF8

public class CharToByteUTF8
extends CharToByteConverter
UCS2 (UTF16) -> UCS Transformation Format 8 (UTF-8) converter It's represented like below. # Bits Bit pattern 1 7 0xxxxxxx 2 11 110xxxxx 10xxxxxx 3 16 1110xxxx 10xxxxxx 10xxxxxx 4 21 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx 5 26 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 6 31 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx UCS2 uses 1-3 / UTF16 uses 1-4 / UCS4 uses 1-6


Constructor Index

 o CharToByteUTF8()

Method Index

 o canConvert(char)
Returns true if the given character can be converted to the target character encoding.
 o convert(char[], int, int, byte[], int, int)
Character conversion
 o flush(byte[], int, int)
Writes any remaining output to the output buffer and resets the converter to its initial state.
 o getCharacterEncoding()
Returns the character set id for the conversion.
 o getMaxBytesPerChar()
Returns the maximum number of bytes needed to convert a char.
 o reset()
Resets converter to its initial state.

Constructors

 o CharToByteUTF8
 public CharToByteUTF8()

Methods

 o flush
 public int flush(byte output[],
                  int outStart,
                  int outEnd) throws MalformedInputException
Writes any remaining output to the output buffer and resets the converter to its initial state.

Overrides:
flush in class CharToByteConverter
 o convert
 public int convert(char input[],
                    int inOff,
                    int inEnd,
                    byte output[],
                    int outOff,
                    int outEnd) throws ConversionBufferFullException, MalformedInputException
Character conversion

Overrides:
convert in class CharToByteConverter
 o canConvert
 public boolean canConvert(char ch)
Returns true if the given character can be converted to the target character encoding.

Overrides:
canConvert in class CharToByteConverter
 o getMaxBytesPerChar
 public int getMaxBytesPerChar()
Returns the maximum number of bytes needed to convert a char.

Overrides:
getMaxBytesPerChar in class CharToByteConverter
 o reset
 public void reset()
Resets converter to its initial state.

Overrides:
reset in class CharToByteConverter
 o getCharacterEncoding
 public String getCharacterEncoding()
Returns the character set id for the conversion.

Overrides:
getCharacterEncoding in class CharToByteConverter

All Packages  Class Hierarchy  This Package  Previous  Next  Index