Package org.apache.tomcat.util.buf
Class UEncoder
java.lang.Object
org.apache.tomcat.util.buf.UEncoder
Efficient implementation of a UTF-8 encoder. This class is not thread safe - you need one encoder per thread. The
encoder will save and recycle the internal objects, avoiding garbage. You can add extra characters that you want
preserved, for example while encoding a URL you can add "/".
- Author:
- Costin Manolache
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionUEncoder
(UEncoder.SafeCharsSet safeCharsSet) Create a UEncoder with an unmodifiable safe character set. -
Method Summary
-
Constructor Details
-
UEncoder
Create a UEncoder with an unmodifiable safe character set.- Parameters:
safeCharsSet
- safe characters for this encoder
-
-
Method Details
-
encodeURL
URL Encode string, using a specified encoding.- Parameters:
s
- string to be encodedstart
- the beginning index, inclusiveend
- the ending index, exclusive- Returns:
- A new CharChunk contained the URL encoded string
- Throws:
IOException
- If an I/O error occurs
-
urlEncode
- Throws:
IOException
-