java.lang.Object
org.glassfish.grizzly.http.util.C2BConverter
Efficient conversion of character to bytes.
Now uses NIO directly
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionC2BConverter(String encoding) Create a converterC2BConverter(ByteChunk output, String encoding) Create a converter, with bytes going to a byte buffer -
Method Summary
Modifier and TypeMethodDescriptionvoidconvert(char c) Generate the bytes using the specified encodingvoidconvert(char[] c, int off, int len) Generate the bytes using the specified encodingvoidGenerate the bytes using the specified encodingvoidGenerate the bytes using the specified encodingvoidconvert(MessageBytes mb) Convert a message bytes chars to bytesvoidFlush any internal buffers into the ByteOutput or the internal byte[]static C2BConvertergetInstance(ByteChunk output, String encoding) voidrecycle()Reset the internal state, empty the buffers.void
-
Field Details
-
bb
-
enc
-
encoder
-
-
Constructor Details
-
C2BConverter
Create a converter, with bytes going to a byte buffer- Throws:
IOException
-
C2BConverter
Create a converter- Throws:
IOException
-
-
Method Details
-
getInstance
- Throws:
IOException
-
getByteChunk
-
getEncoding
-
setByteChunk
-
recycle
public void recycle()Reset the internal state, empty the buffers. The encoding remain in effect, the internal buffers remain allocated. -
convert
Generate the bytes using the specified encoding- Throws:
IOException
-
convert
Generate the bytes using the specified encoding- Throws:
IOException
-
convert
Generate the bytes using the specified encoding- Throws:
IOException
-
convert
Generate the bytes using the specified encoding- Throws:
IOException
-
convert
Convert a message bytes chars to bytes- Throws:
IOException
-
flushBuffer
Flush any internal buffers into the ByteOutput or the internal byte[]- Throws:
IOException
-