Save This Page
Home » apache-tomcat-6.0.26-src » org.apache » tomcat » util » buf » [javadoc | source]
org.apache.tomcat.util.buf
public final class: C2BConverter [javadoc | source]
java.lang.Object
   org.apache.tomcat.util.buf.C2BConverter
Efficient conversion of character to bytes. This uses the standard JDK mechansim - a writer - but provides mechanisms to recycle all the objects that are used. It is compatible with JDK1.1 and up, ( nio is better, but it's not available even in 1.2 or 1.3 )
Constructor:
 public C2BConverter(String encoding) throws IOException 
    Create a converter
 public C2BConverter(ByteChunk output,
    String encoding) throws IOException 
    Create a converter, with bytes going to a byte buffer
Method from org.apache.tomcat.util.buf.C2BConverter Summary:
convert,   convert,   convert,   convert,   convert,   flushBuffer,   getByteChunk,   getEncoding,   recycle,   setByteChunk
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.util.buf.C2BConverter Detail:
 public final  void convert(String s) throws IOException 
    Generate the bytes using the specified encoding
 public final  void convert(char c) throws IOException 
    Generate the bytes using the specified encoding
 public final  void convert(MessageBytes mb) throws IOException 
    Convert a message bytes chars to bytes
 public final  void convert(char[] c,
    int off,
    int len) throws IOException 
    Generate the bytes using the specified encoding
 public final  void convert(String s,
    int off,
    int len) throws IOException 
    Generate the bytes using the specified encoding
 public final  void flushBuffer() throws IOException 
    Flush any internal buffers into the ByteOutput or the internal byte[]
 public ByteChunk getByteChunk() 
 public String getEncoding() 
 public final  void recycle() 
    Reset the internal state, empty the buffers. The encoding remain in effect, the internal buffers remain allocated.
 public  void setByteChunk(ByteChunk bb)