org.apache.tomcat.util.buf
Class B2CConverter

java.lang.Object
  extended by org.apache.tomcat.util.buf.B2CConverter
Direct Known Subclasses:
UTF8Decoder

public class B2CConverter
extends java.lang.Object

NIO based character decoder.

Author:
Remy Maucherat

Field Summary
protected  java.nio.ByteBuffer bb
           
protected  java.nio.CharBuffer cb
           
protected  java.nio.charset.CharsetDecoder decoder
           
protected  java.nio.ByteBuffer leftovers
          Leftover buffer used for incomplete characters.
protected static org.jboss.logging.Logger log
           
 
Constructor Summary
B2CConverter(java.lang.String charset)
          Create a decoder for the specified charset.
 
Method Summary
 void convert(ByteChunk bc, CharChunk cc)
          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
 

Field Detail

log

protected static org.jboss.logging.Logger log

decoder

protected java.nio.charset.CharsetDecoder decoder

bb

protected java.nio.ByteBuffer bb

cb

protected java.nio.CharBuffer cb

leftovers

protected java.nio.ByteBuffer leftovers
Leftover buffer used for incomplete characters.

Constructor Detail

B2CConverter

public B2CConverter(java.lang.String charset)
             throws java.io.IOException
Create a decoder for the specified charset.

Throws:
java.io.IOException
Method Detail

recycle

public void recycle()
Reset the decoder state, and empty the leftover buffer.


convert

public void convert(ByteChunk bc,
                    CharChunk cc)
             throws java.io.IOException
Convert the given bytes to characters.

Parameters:
bc - byte input
cc - char output
Throws:
java.io.IOException


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.