org.apache.tomcat.util.buf
Class C2BConverter

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

public class C2BConverter
extends java.lang.Object

NIO based character encoder.

Author:
Remy Maucherat

Field Summary
protected  java.nio.ByteBuffer bb
           
protected  java.nio.CharBuffer cb
           
protected  java.nio.charset.CharsetEncoder encoder
           
protected static org.jboss.logging.Logger log
           
 
Constructor Summary
C2BConverter(java.lang.String charset)
          Create an encoder for the specified charset.
 
Method Summary
 void convert(CharChunk cc, ByteChunk bc)
          Convert the given characters to bytes.
 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

log

protected static org.jboss.logging.Logger log

encoder

protected java.nio.charset.CharsetEncoder encoder

bb

protected java.nio.ByteBuffer bb

cb

protected java.nio.CharBuffer cb
Constructor Detail

C2BConverter

public C2BConverter(java.lang.String charset)
             throws java.io.IOException
Create an encoder for the specified charset.

Throws:
java.io.IOException
Method Detail

recycle

public void recycle()
Reset the encoder state.


convert

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

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


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