Apache Tomcat 7.0.42

org.apache.tomcat.util.buf
Class C2BConverter

java.lang.Object
  extended by org.apache.tomcat.util.buf.C2BConverter

public final class C2BConverter
extends Object

NIO based character encoder.


Field Summary
protected  ByteBuffer bb
           
protected  CharBuffer cb
           
protected  CharsetEncoder encoder
           
protected  CharBuffer leftovers
          Leftover buffer used for multi-characters characters.
 
Constructor Summary
C2BConverter(String encoding)
           
 
Method Summary
 void convert(CharChunk cc, ByteChunk bc)
          Convert the given characters to bytes.
 boolean isUndeflow()
           
 void recycle()
          Reset the encoder state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encoder

protected CharsetEncoder encoder

bb

protected ByteBuffer bb

cb

protected CharBuffer cb

leftovers

protected CharBuffer leftovers
Leftover buffer used for multi-characters characters.

Constructor Detail

C2BConverter

public C2BConverter(String encoding)
             throws IOException
Throws:
IOException
Method Detail

recycle

public void recycle()
Reset the encoder state.


isUndeflow

public boolean isUndeflow()

convert

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

Parameters:
cc - char input
bc - byte output
Throws:
IOException

Apache Tomcat 7.0.42

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