public abstract class

ByteToCharSingleByte

extends ByteToCharConverter
java.lang.Object
   ↳ sun.io.ByteToCharConverter
     ↳ sun.io.ByteToCharSingleByte
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

A table driven conversion from byte to char for single byte character sets. The needed data tables will reside in a character set specific subclass.

Summary

Fields
protected String byteToCharTable Mapping table.
[Expand]
Inherited Fields
From class sun.io.ByteToCharConverter
Public Constructors
ByteToCharSingleByte()
Public Methods
int convert(byte[] input, int inOff, int inEnd, char[] output, int outOff, int outEnd)
Converts bytes to characters according to the selected character encoding.
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 getByteToCharTable()
void reset()
Resets the converter.
Protected Methods
char getUnicode(int byteIndex)
[Expand]
Inherited Methods
From class sun.io.ByteToCharConverter
From class java.lang.Object

Fields

protected String byteToCharTable

Mapping table. Values supplied by subclass

Public Constructors

public ByteToCharSingleByte ()

Public Methods

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

Converts bytes to characters according to the selected character encoding. Maintains internal state, so that conversions that result in exceptions can be restarted by calling convert again, with appropriately modified parameters. Call reset before converting input that is not a continuation of the previous call.

Parameters
input byte array containing text in character set
inOff begin conversion at this offset in input array.
inEnd offset of last byte to be converted
output character array to receive conversion result
outOff start writing to output array at this offset.
outEnd offset of last character to be written to
Returns
  • the number of characters written to output.
See Also

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

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

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

public String getByteToCharTable ()

public void reset ()

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

Protected Methods

protected char getUnicode (int byteIndex)