|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.ByteArrayOutputStream
wt.httpgw.WTURLEncoder
The class contains a utility method for converting a
String
into a MIME format called
"x-www-form-urlencoded
" and vice versa.
To convert a String
, each character is examined in turn:
a
' through 'z
',
'A
' through 'Z
', and '0
'
through '9
' remain the same.
' is converted into a
plus sign '+
'.
%xy
", where xy is the
two-digit hexadecimal representation of the byte.
Deployment Notes:
EncodingConverter
Supported API: false
Extendable: false
Field Summary | |
(package private) static WTURLEncoder |
byteBuf
Deprecated. |
(package private) static ByteArrayOutputStream |
convertBuf
Deprecated. |
private static EncodingConverter |
cvDecoder
Deprecated. |
private static EncodingConverter |
cvEncoder
Deprecated. |
(package private) static OutputStreamWriter |
defaultWriter
Deprecated. |
Fields inherited from class java.io.ByteArrayOutputStream |
buf, count |
Constructor Summary | |
private |
WTURLEncoder()
Deprecated. |
Method Summary | |
static String |
decode(String s)
Deprecated. Translates a string from x-www-form-urlencoded format back
into a string. |
static String |
decode(String encoded,
String encoding)
Deprecated. Translates a string from x-www-form-urlencoded format back the original
string. |
static String |
encode(String s)
Deprecated. |
static void |
encode(StringBuffer buf,
String s)
Deprecated. |
static void |
encode(StringBuffer buf,
String s,
String encoding)
Deprecated. |
static String |
encode(String s,
String encoding)
Deprecated. |
Methods inherited from class java.io.ByteArrayOutputStream |
close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo |
Methods inherited from class java.io.OutputStream |
flush, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static WTURLEncoder byteBuf
static ByteArrayOutputStream convertBuf
static OutputStreamWriter defaultWriter
private static EncodingConverter cvDecoder
private static EncodingConverter cvEncoder
Constructor Detail |
private WTURLEncoder()
Method Detail |
public static String encode(String s)
x-www-form-urlencoded
format.
Hex escaped characters are first encoded using UTF8 character encoding
before Hex escaping the resulting bytes. This produces an encoded
string that can be decoded without loss of data.
s
- String
to be translated.
String
.wt.httpgw.EncodingConverter.encode(String)
public static String encode(String s, String encoding)
x-www-form-urlencoded
format.
Hex escaped characters are first encoded using the given character encoding
before Hex escaping the resulting bytes.
s
- String
to be translated.encoding
- the character encoding name
String
.wt.httpgw.EncodingConverter.encode(String,String)
public static void encode(StringBuffer buf, String s)
x-www-form-urlencoded
format.
Hex escaped characters are first encoded using UTF8 character encoding
before Hex escaping the resulting bytes. This produces an encoded
string that can be decoded without loss of data.
buf
- StringBuffer
to receive encoded characters.s
- String
to be translated.wt.httpgw.EncodingConverter.encode(StringBuffer,String)
public static void encode(StringBuffer buf, String s, String encoding)
x-www-form-urlencoded
format.
Hex escaped characters are first encoded using the given character encoding
before Hex escaping the resulting bytes.
buf
- StringBuffer
to receive encoded characters.s
- String
to be translated.encoding
- the character encoding namewt.httpgw.EncodingConverter.encode(StringBuffer,String,String)
public static String decode(String s)
x-www-form-urlencoded
format back
into a string. Hex escaped bytes are converted and the resulting sequence of 8-bit
values is converted to characters using UTF8 encoding. This produces a decoded
string from the results of encode
without loss data.
s
- String
to be translated.
String
.wt.httpgw.EncodingConverter.deocde(String)
public static String decode(String encoded, String encoding)
x-www-form-urlencoded
format back the original
string. Hex escaped bytes are converted and the resulting sequence of 8-bit values
is converted to characters using the given character encoding.
encoded
- String
to be translated.encoding
- the character encoding name
String
.wt.httpgw.EncodingConverter.deocde(String,String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |