public abstract class

CharToByteSingleByte

extends CharToByteConverter
java.lang.Object
   ↳ sun.io.CharToByteConverter
     ↳ sun.io.CharToByteSingleByte
Known Direct Subclasses

Class Overview

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

Summary

Fields
protected short[] index1
protected String index2
protected int mask1
protected int mask2
protected int shift
[Expand]
Inherited Fields
From class sun.io.CharToByteConverter
Public Constructors
CharToByteSingleByte()
Public Methods
boolean canConvert(char ch)
Return whether a character is mappable or not
int convert(char[] input, int inOff, int inEnd, byte[] output, int outOff, int outEnd)
Converts characters to sequences of bytes.
int flush(byte[] output, int outStart, int outEnd)
Writes any remaining output to the output buffer and resets the converter to its initial state.
short[] getIndex1()
String getIndex2()
int getMaxBytesPerChar()
the maximum number of bytes needed to hold a converted char
byte getNative(char inputChar)
void reset()
Resets the converter.
[Expand]
Inherited Methods
From class sun.io.CharToByteConverter
From class java.lang.Object

Fields

protected short[] index1

protected String index2

protected int mask1

protected int mask2

protected int shift

Public Constructors

public CharToByteSingleByte ()

Public Methods

public boolean canConvert (char ch)

Return whether a character is mappable or not

Parameters
ch character to test
Returns
  • true if a character is mappable

public int convert (char[] input, int inOff, int inEnd, byte[] output, int outOff, int outEnd)

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
inOff begin conversion at this offset in input array.
inEnd offset of last byte to be converted
output byte array to receive conversion result
outOff start writing to output array at this offset.
outEnd offset of last byte to be written to
Returns
  • the characters written to output.

public int flush (byte[] output, int outStart, int outEnd)

Writes any remaining output to the output buffer and resets the converter to its initial state.

Parameters
output byte array to receive flushed output.
outStart start writing to output array at this offset.
outEnd stop writing to output array at this offset (exclusive).

public short[] getIndex1 ()

public String getIndex2 ()

public int getMaxBytesPerChar ()

the maximum number of bytes needed to hold a converted char

public byte getNative (char inputChar)

public void reset ()

Resets the converter. Call this method to reset the converter to its initial state