Package org.apache.tomcat.util.buf
Class B2CConverter
java.lang.Object
org.apache.tomcat.util.buf.B2CConverter
NIO based character decoder.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionB2CConverter
(Charset charset) B2CConverter
(Charset charset, boolean replaceOnError) -
Method Summary
Modifier and TypeMethodDescriptionvoid
convert
(ByteBuffer bc, CharBuffer cc, ByteChunk.ByteInputChannel ic, boolean endOfInput) Convert the given bytes to characters.void
Convert the given bytes to characters.static Charset
getCharset
(String enc) Obtain the Charset for the given encodingstatic Charset
getCharsetLower
(String lowerCaseEnc) Deprecated.Will be removed in Tomcat 9.0.xvoid
recycle()
Reset the decoder state.
-
Field Details
-
LEFTOVER_SIZE
protected static final int LEFTOVER_SIZE- See Also:
-
-
Constructor Details
-
B2CConverter
-
B2CConverter
-
-
Method Details
-
getCharset
Obtain the Charset for the given encoding- Parameters:
enc
- The name of the encoding for the required charset- Returns:
- The Charset corresponding to the requested encoding
- Throws:
UnsupportedEncodingException
- If the requested Charset is not available
-
getCharsetLower
@Deprecated public static Charset getCharsetLower(String lowerCaseEnc) throws UnsupportedEncodingException Deprecated.Will be removed in Tomcat 9.0.xOnly to be used when it is known that the encoding name is in lower case.- Parameters:
lowerCaseEnc
- The name of the encoding for the required charset in lower case- Returns:
- The Charset corresponding to the requested encoding
- Throws:
UnsupportedEncodingException
- If the requested Charset is not available
-
recycle
public void recycle()Reset the decoder state. -
convert
Convert the given bytes to characters.- Parameters:
bc
- byte inputcc
- char outputendOfInput
- Is this all of the available data- Throws:
IOException
- If the conversion can not be completed
-
convert
public void convert(ByteBuffer bc, CharBuffer cc, ByteChunk.ByteInputChannel ic, boolean endOfInput) throws IOException Convert the given bytes to characters.- Parameters:
bc
- byte inputcc
- char outputic
- byte input channelendOfInput
- Is this all of the available data- Throws:
IOException
- If the conversion can not be completed
-
getCharset
-