| |
|
| java.lang.Object java.io.InputStream com.caucho.vfs.AbstractByteToChar
All known Subclasses: com.caucho.vfs.ByteToCharWriter, com.caucho.vfs.ByteToChar,
AbstractByteToChar | abstract public class AbstractByteToChar extends InputStream (Code) | | 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 | |
public void | addByte(int b) Adds the next byte. | public void | addChar(char nextCh) Adds the next character. | public void | clear() | public void | flush() Flushes the buffer. | abstract protected void | outputChar(int ch) | public int | read() For internal use only. | public void | setEncoding(String encoding) Sets the encoding for the converter. |
AbstractByteToChar | AbstractByteToChar()(Code) | | Creates an uninitialized converter. Use init to initialize.
|
addByte | public void addByte(int b) throws IOException(Code) | | Adds the next byte.
Parameters: b - the byte to write |
addChar | public void addChar(char nextCh) throws IOException(Code) | | Adds the next character.
Parameters: nextCh - the character to write |
clear | public void clear()(Code) | | Clears the converted
|
read | public int read() throws IOException(Code) | | For internal use only. Reads the next byte from the byte buffer.
the next byte |
|
|
|