org.apache.tomcat.util.buf
Class UEncoder
java.lang.Object
org.apache.tomcat.util.buf.UEncoder
public final class UEncoder
- extends Object
Efficient implementation for encoders.
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UEncoder
public UEncoder()
setEncoding
@Deprecated
public void setEncoding(String s)
- Deprecated. Unused. Will be removed in Tomcat 8.0.x onwards.
addSafeCharacter
public void addSafeCharacter(char c)
encodeURL
public CharChunk encodeURL(String s,
int start,
int end)
throws IOException
- URL Encode string, using a specified encoding.
- Parameters:
s
- string to be encodedstart
- the beginning index, inclusiveend
- the ending index, exclusive
- Throws:
IOException
- If an I/O error occurs
urlEncode
protected void urlEncode(CharChunk out,
ByteChunk bb)
throws IOException
- Throws:
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.