|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.http.util.UEncoder
public final class UEncoder
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 "/".
| Constructor Summary | |
|---|---|
UEncoder()
|
|
| Method Summary | |
|---|---|
void |
addSafeCharacter(char c)
|
String |
encodeURL(String url)
Utility funtion to re-encode the URL. |
String |
encodeURL(String uri,
boolean toHexUpperCase)
Utility function to re-encode the URL. |
void |
setEncoding(String s)
|
void |
urlEncode(Writer buf,
byte[] bytes,
int off,
int len)
|
void |
urlEncode(Writer buf,
byte[] bytes,
int off,
int len,
boolean toHexUpperCase)
|
void |
urlEncode(Writer buf,
String s)
URL Encode string, using a specified encoding. |
void |
urlEncode(Writer buf,
String s,
boolean toHexUpperCase)
URL Encode string, using a specified encoding. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UEncoder()
| Method Detail |
|---|
public void setEncoding(String s)
public void addSafeCharacter(char c)
public void urlEncode(Writer buf,
String s)
throws IOException
buf - the Writer to write the encoded result to.s - the String to encode.
IOException
public void urlEncode(Writer buf,
String s,
boolean toHexUpperCase)
throws IOException
buf - the Writer to write the encoded result to.s - the String to encode.toHexUpperCase - the hex string will be in upper case
IOException
public void urlEncode(Writer buf,
byte[] bytes,
int off,
int len)
throws IOException
IOException
public void urlEncode(Writer buf,
byte[] bytes,
int off,
int len,
boolean toHexUpperCase)
throws IOException
IOExceptionpublic String encodeURL(String url)
url -
public String encodeURL(String uri,
boolean toHexUpperCase)
uri - the URI to encode.toHexUpperCase - the hex string will be in upper case
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||