Package org.glassfish.grizzly.http.util
Class B2CConverterBlocking
- java.lang.Object
-
- org.glassfish.grizzly.http.util.B2CConverterBlocking
-
public class B2CConverterBlocking extends Object
Efficient conversion of bytes to character . This uses the standard JDK mechanism - 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
Constructors Modifier Constructor Description protectedB2CConverterBlocking()B2CConverterBlocking(String encoding)Create a converter, with bytes going to a byte buffer
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidconvert(ByteChunk bb, CharChunk cb)Deprecated.voidconvert(ByteChunk bb, CharChunk cb, int limit)static voidconvertASCII(MessageBytes mb)Character conversion of a US-ASCII MessageBytes.voidrecycle()Reset the internal state, empty the buffers.voidreset()
-
-
-
Constructor Detail
-
B2CConverterBlocking
protected B2CConverterBlocking()
-
B2CConverterBlocking
public B2CConverterBlocking(String encoding) throws IOException
Create a converter, with bytes going to a byte buffer- Throws:
IOException
-
-
Method Detail
-
recycle
public void recycle()
Reset the internal state, empty the buffers. The encoding remain in effect, the internal buffers remain allocated.
-
convert
@Deprecated public void convert(ByteChunk bb, CharChunk cb) throws IOException
Deprecated.Convert a buffer of bytes into a chars- Throws:
IOException
-
convert
public void convert(ByteChunk bb, CharChunk cb, int limit) throws IOException
- Throws:
IOException
-
convertASCII
public static void convertASCII(MessageBytes mb)
Character conversion of a US-ASCII MessageBytes.
-
reset
public void reset() throws IOException- Throws:
IOException
-
-