Class C2BConverter
java.lang.Object
org.apache.tomcat.util.buf.C2BConverter
NIO based character encoder.
-
Constructor Summary
ConstructorsConstructorDescriptionC2BConverter(Charset charset) Constructs a C2BConverter for the given charset. -
Method Summary
Modifier and TypeMethodDescriptionvoidconvert(CharBuffer cc, ByteBuffer bc) Convert the given characters to bytes.voidConvert the given characters to bytes.Returns the charset used by this converter.booleanDeprecated.booleanReturns whether there are leftover characters pending encoding.voidrecycle()Reset the encoder state.
-
Constructor Details
-
C2BConverter
Constructs a C2BConverter for the given charset.- Parameters:
charset- the charset to use for encoding
-
-
Method Details
-
recycle
public void recycle()Reset the encoder state. -
isUnderflow
public boolean isUnderflow()Returns whether there are leftover characters pending encoding.- Returns:
- true if there are leftovers
-
isUndeflow
Deprecated.Returns whether there are leftover characters pending encoding.- Returns:
- true if there are leftovers
-
convert
Convert the given characters to bytes.- Parameters:
cc- char inputbc- byte output- Throws:
IOException- An encoding error occurred
-
convert
Convert the given characters to bytes.- Parameters:
cc- char inputbc- byte output- Throws:
IOException- An encoding error occurred
-
getCharset
-