public abstract class AbstractByteToChar
extends java.io.InputStream
ByteToChar converter = new ByteToChar(); converter.setEncoding("utf-8"); converter.clear(); converter.addChar('H'); converter.addByte(0xc0); converter.addByte(0xb8); String value = converter.getConvertedString();
Modifier and Type | Method and Description |
---|---|
void |
addByte(int b)
Adds the next byte.
|
void |
addChar(char nextCh)
Adds the next character.
|
void |
clear()
Clears the converted
|
void |
flush()
Flushes the buffer.
|
protected abstract void |
outputChar(int ch) |
int |
read()
For internal use only.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding for the converter.
|
public void setEncoding(java.lang.String encoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public void clear()
public void addByte(int b) throws java.io.IOException
b
- the byte to writejava.io.IOException
public void addChar(char nextCh) throws java.io.IOException
nextCh
- the character to writejava.io.IOException
public void flush() throws java.io.IOException
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
protected abstract void outputChar(int ch) throws java.io.IOException
java.io.IOException