private static class URIUtils.EncodingUtils
extends java.lang.Object
This was forked from some needed methods such as #getBytes(...)
and #getAsciiString(...)
in org.apache.commons.httpclient.util.EncodingUtil
,
in order to not be dependent on HttpClient v3 API, when generating and handling GenericURLFileName
s,
but it should work with any different HTTP backend provider implementations.
Modifier | Constructor and Description |
---|---|
private |
EncodingUtils() |
Modifier and Type | Method and Description |
---|---|
(package private) static java.lang.String |
getAsciiString(byte[] data,
int offset,
int length)
Converts the byte array of ASCII characters to a string.
|
(package private) static byte[] |
getBytes(java.lang.String data,
java.lang.String charset)
Converts the specified string to a byte array.
|
static byte[] getBytes(java.lang.String data, java.lang.String charset)
data
- the string to be encodedcharset
- the desired character encodingstatic java.lang.String getAsciiString(byte[] data, int offset, int length)
data
- the byte array to be encodedoffset
- the index of the first byte to encodelength
- the number of bytes to encode