public final class OldByteToChar extends ByteToChar
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
|
java.lang.String |
getConvertedString()
Gets the converted string.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding for the converter.
|
java.lang.String |
toString()
Prints the object.
|
create, outputCharflush, readpublic void setEncoding(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
setEncoding in class AbstractByteToCharjava.io.UnsupportedEncodingExceptionpublic void clear()
clear in class ByteToCharpublic java.lang.String getConvertedString()
throws java.io.IOException
getConvertedString in class ByteToCharjava.io.IOExceptionpublic void addByte(int b)
throws java.io.IOException
addByte in class AbstractByteToCharb - the byte to writejava.io.IOExceptionpublic void addChar(char nextCh)
throws java.io.IOException
addChar in class AbstractByteToCharnextCh - the character to writejava.io.IOExceptionpublic java.lang.String toString()
toString in class ByteToChar