| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tomcat.util.buf.B2CConverter
public class B2CConverter
Efficient conversion of bytes to character . This uses the standard JDK mechansim - a reader - 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 ) Not used in the current code, the performance gain is not very big in the current case ( since String is created anyway ), but it will be used in a later version or after the remaining optimizations.
| Constructor Summary | |
|---|---|
| protected  | B2CConverter() | 
|   | B2CConverter(java.lang.String encoding)Create a converter, with bytes going to a byte buffer | 
| Method Summary | |
|---|---|
|  void | convert(ByteChunk bb,
        CharChunk cb)Deprecated. | 
|  void | convert(ByteChunk bb,
        CharChunk cb,
        int limit)Convert a buffer of bytes into a chars. | 
| static java.nio.charset.Charset | getCharset(java.lang.String enc) | 
|  void | recycle()Reset the internal state, empty the buffers. | 
|  void | reset() | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
protected B2CConverter()
public B2CConverter(java.lang.String encoding)
             throws java.io.IOException
java.io.IOException| Method Detail | 
|---|
public static java.nio.charset.Charset getCharset(java.lang.String enc)
                                           throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic void recycle()
public void convert(ByteChunk bb,
                    CharChunk cb)
             throws java.io.IOException
java.io.IOException
public void convert(ByteChunk bb,
                    CharChunk cb,
                    int limit)
             throws java.io.IOException
bb - Input byte buffercb - Output char bufferlimit - Number of bytes to convert
java.io.IOException
public void reset()
           throws java.io.IOException
java.io.IOException| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||