All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.io.CharToByteSingleByte

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

public abstract class CharToByteSingleByte
extends CharToByteConverter
A table driven conversion from char to byte for single byte character sets. Tables will reside in the class CharToByteYYYYY, where YYYYY is a unique character set identifier < TBD: Tables are of the form... >


Variable Index

 o badInputLength
 o index1
 o index2
 o mask1
 o mask2
 o shift

Constructor Index

 o CharToByteSingleByte()

Method Index

 o canConvert(char)
Return whether a character is mappable or not
 o convert(char[], int, int, byte[], int, int)
Converts characters to sequences of bytes.
 o flush(byte[], int, int)
Writes any remaining output to the output buffer and resets the converter to its initial state.
 o getMaxBytesPerChar()
the maximum number of bytes needed to hold a converted char
 o reset()
Resets the converter.

Variables

 o index1
 protected short index1[]
 o index2
 protected byte index2[]
 o mask1
 protected int mask1
 o mask2
 protected int mask2
 o shift
 protected int shift
 o badInputLength
 protected int badInputLength

Constructors

 o CharToByteSingleByte
 public CharToByteSingleByte()

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 MalformedInputException, UnknownCharacterException, ConversionBufferFullException
Converts characters to sequences of bytes. Conversions that result in Exceptions can be restarted by calling convert again, with appropriately modified parameters.

Parameters:
input - char array containing text in Unicode
inStart - offset in input array
inEnd - offset of last byte to be converted
output - byte array to receive conversion result
outStart - starting offset
outEnd - offset of last byte to be written to
Returns:
the characters written to output.
Overrides:
convert in class CharToByteConverter
 o getMaxBytesPerChar
 public int getMaxBytesPerChar()
the maximum number of bytes needed to hold a converted char

Returns:
s the maximum number of bytes needed for a converted char
Overrides:
getMaxBytesPerChar in class CharToByteConverter
 o reset
 public void reset()
Resets the converter. Call this method to reset the converter to its initial state

Overrides:
reset in class CharToByteConverter
 o canConvert
 public boolean canConvert(char ch)
Return whether a character is mappable or not

Returns:
true if a character is mappable
Overrides:
canConvert in class CharToByteConverter

All Packages  Class Hierarchy  This Package  Previous  Next  Index