com.caucho.vfs
Class ByteToCharWriter

java.lang.Object
  extended by java.io.InputStream
      extended by com.caucho.vfs.AbstractByteToChar
          extended by com.caucho.vfs.ByteToCharWriter
All Implemented Interfaces:
java.io.Closeable

public class ByteToCharWriter
extends AbstractByteToChar

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
protected  void outputChar(int ch)
           
 void setWriter(java.io.Writer writer)
          Sets the writer.
 
Methods inherited from class com.caucho.vfs.AbstractByteToChar
addByte, addChar, clear, flush, read, setEncoding
 
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, toString, wait, wait, wait
 

Method Detail

setWriter

public void setWriter(java.io.Writer writer)
Sets the writer.


outputChar

protected void outputChar(int ch)
                   throws java.io.IOException
Specified by:
outputChar in class AbstractByteToChar
Throws:
java.io.IOException