org.apache.tomcat.util.buf
Class UTF8Decoder
java.lang.Object
org.apache.tomcat.util.buf.B2CConverter
org.apache.tomcat.util.buf.UTF8Decoder
public final class UTF8Decoder
- extends B2CConverter
Moved from ByteChunk - code to convert from UTF8 bytes to chars.
Not used in the current tomcat3.3 : the performance gain is not very
big if the String is created, only if we avoid that and work only
on char[]. Until than, it's better to be safe. ( I tested this code
with 2 and 3 bytes chars, and it works fine in xerces )
Cut from xerces' UTF8Reader.copyMultiByteCharData()
- Author:
- Costin Manolache, ( Xml-Xerces )
Method Summary |
void |
convert(ByteChunk mb,
CharChunk cb)
Convert the given bytes to characters. |
void |
recycle()
Reset the decoder state, and empty the leftover buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UTF8Decoder
public UTF8Decoder()
throws java.io.IOException
- Throws:
java.io.IOException
recycle
public void recycle()
- Description copied from class:
B2CConverter
- Reset the decoder state, and empty the leftover buffer.
- Overrides:
recycle
in class B2CConverter
convert
public void convert(ByteChunk mb,
CharChunk cb)
throws java.io.IOException
- Description copied from class:
B2CConverter
- Convert the given bytes to characters.
- Overrides:
convert
in class B2CConverter
- Parameters:
mb
- byte inputcb
- char output
- Throws:
java.io.IOException
Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.