com.caucho.vfs
Class ByteToChar

java.lang.Object
  extended by java.io.InputStream
      extended by com.caucho.vfs.AbstractByteToChar
          extended by com.caucho.vfs.ByteToChar
All Implemented Interfaces:
java.io.Closeable
Direct Known Subclasses:
OldByteToChar

public class ByteToChar
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
 void clear()
          Clears the converted
static ByteToChar create()
           
 java.lang.String getConvertedString()
          Gets the converted string.
protected  void outputChar(int ch)
           
 java.lang.String toString()
          Prints the object.
 
Methods inherited from class com.caucho.vfs.AbstractByteToChar
addByte, addChar, 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, wait, wait, wait
 

Method Detail

create

public static ByteToChar create()

clear

public void clear()
Clears the converted

Overrides:
clear in class AbstractByteToChar

getConvertedString

public java.lang.String getConvertedString()
                                    throws java.io.IOException
Gets the converted string.

Throws:
java.io.IOException

outputChar

protected void outputChar(int ch)
Specified by:
outputChar in class AbstractByteToChar

toString

public java.lang.String toString()
Prints the object.

Overrides:
toString in class java.lang.Object