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

public Class B2CConverter

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, .CharBuffer, java.nio.charset.Charset, .CharsetDecoder, .CoderResult, .CodingErrorAction, java.util.logging.Level, .Logger, org.glassfish.grizzly.Grizzly, org.glassfish.grizzly.utils.Charsets

Efficient conversion of bytes to character . Now uses NIO directly

Field Summary

Modifier and TypeField and Description
private B2CConverterBlocking
private CharsetDecoder
private static final boolean
IS_OLD_IO_MODE

Default Logger.

private static final Logger
private static final int
private final ByteBuffer

Constructor Summary

AccessConstructor and Description
protected
public
B2CConverter(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)

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.

private void
protected void
init(String encoding)

pack-priv void
public void
recycle()

Reset the internal state, empty the buffers.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blockingConverterback to summary
private B2CConverterBlocking blockingConverter
decoderback to summary
private CharsetDecoder decoder
IS_OLD_IO_MODEback to summary
private static final boolean IS_OLD_IO_MODE

Default Logger.

loggerback to summary
private static final Logger logger
MAX_NUMBER_OF_BYTES_PER_CHARACTERback to summary
private static final int MAX_NUMBER_OF_BYTES_PER_CHARACTER
remainderback to summary
private final ByteBuffer remainder

Constructor Detail

B2CConverterback to summary
protected B2CConverter()
B2CConverterback to summary
public B2CConverter(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

Convert a buffer of bytes into a chars

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.

flushRemainderback to summary
private void flushRemainder(ByteBuffer tmp_bb, CharBuffer tmp_cb)
initback to summary
protected void init(String encoding)
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