Top Description Fields Constructors Methods
org.glassfish.grizzly.http.util

public Class B2CConverterBlocking

Additional top-level classes in compilation unit: ReadConverter, IntermediateInputStream.

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .InputStreamReader, .UnsupportedEncodingException, java.nio.charset.Charset, java.util.logging.Level, .Logger, org.glassfish.grizzly.Grizzly, org.glassfish.grizzly.utils.Charsets

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.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
private ReadConverter
private String
private IntermediateInputStream
private static final Logger
logger

Default Logger.

pack-priv final char[]

Constructor Summary

AccessConstructor and Description
protected
public
B2CConverterBlocking(String encoding)

Create a converter, with bytes going to a byte buffer

Method Summary

Modifier and TypeMethod and Description
public void
convert(ByteChunk bb, CharChunk cb)
Deprecated

Convert a buffer of bytes into a chars

public void
convert(ByteChunk bb, CharChunk cb, int limit)

public static void
convertASCII(MessageBytes mb)

Character conversion of a US-ASCII MessageBytes.

pack-priv void
public void
recycle()

Reset the internal state, empty the buffers.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BUFFER_SIZEback to summary
pack-priv static final int BUFFER_SIZE
convback to summary
private ReadConverter conv
encodingback to summary
private String encoding
iisback to summary
private IntermediateInputStream iis
loggerback to summary
private static final Logger logger

Default Logger.

resultback to summary
pack-priv final char[] result

Constructor Detail

B2CConverterBlockingback to summary
protected B2CConverterBlocking()
B2CConverterBlockingback to summary
public B2CConverterBlocking(String encoding) throws IOException

Create a converter, with bytes going to a byte buffer

Method Detail

convertback to summary
public void convert(ByteChunk bb, CharChunk cb) throws IOException

Deprecated

Convert a buffer of bytes into a chars

Annotations
@Deprecated
convertback to summary
public void convert(ByteChunk bb, CharChunk cb, int limit) throws IOException
convertASCIIback to summary
public static void convertASCII(MessageBytes mb)

Character conversion of a US-ASCII MessageBytes.

logback to summary
pack-priv void log(String s)
recycleback to summary
public void recycle()

Reset the internal state, empty the buffers. The encoding remain in effect, the internal buffers remain allocated.

resetback to summary
public void reset() throws IOException