|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
com.caucho.vfs.AbstractByteToChar
com.caucho.vfs.ByteToChar
com.caucho.vfs.OldByteToChar
public final class OldByteToChar
Utility class for converting a byte stream to a character stream.
ByteToChar converter = new ByteToChar(); converter.setEncoding("utf-8"); converter.clear(); converter.addChar('H'); converter.addByte(0xc0); converter.addByte(0xb8); String value = converter.getConvertedString();
Method Summary | |
---|---|
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. |
Methods inherited from class com.caucho.vfs.ByteToChar |
---|
create, outputChar |
Methods inherited from class com.caucho.vfs.AbstractByteToChar |
---|
flush, read |
Methods inherited from class java.io.InputStream |
---|
available, close, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void setEncoding(java.lang.String encoding) throws java.io.UnsupportedEncodingException
setEncoding
in class AbstractByteToChar
java.io.UnsupportedEncodingException
public void clear()
clear
in class ByteToChar
public java.lang.String getConvertedString() throws java.io.IOException
getConvertedString
in class ByteToChar
java.io.IOException
public void addByte(int b) throws java.io.IOException
addByte
in class AbstractByteToChar
b
- the byte to write
java.io.IOException
public void addChar(char nextCh) throws java.io.IOException
addChar
in class AbstractByteToChar
nextCh
- the character to write
java.io.IOException
public java.lang.String toString()
toString
in class ByteToChar
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |