- public class utils
- extends java.lang.Object
Utility class containing miscellaneous static utility methods.
utils()
-
b64Decode(byte[])
- Decodes a base 64 byte[]
b64Decode(String)
- Decodes a base 64 string.
b64Encode(String)
- Encodes the specified string in base 64.
getCookieAttr(String, String)
- Extracts the specifed attribute value from an HTTP cookie header.
qsDecode(String)
- Decodes a "query string".
qsEncode(String)
- Encodes the specified string encoded in "query string" format.
strToByteArr(String)
- Returns a representation of a String to a byte[],
mapping each character to a single byte.
utils
public utils()
strToByteArr
public static byte[] strToByteArr(java.lang.String theString)
Returns a representation of a String to a byte[],
mapping each character to a single byte.
- Parameters:
theString
- the string to convert
- Returns:
- a byte[] representation of the specified string
getCookieAttr
public static java.lang.String getCookieAttr(java.lang.String theCookie,
java.lang.String theAttribute)
Extracts the specifed attribute value from an HTTP cookie header.
- Parameters:
theCookie
- data part of the cookie header
theAttribute
- the name of the attribute to extract
- Returns:
- the value of the attribute specified
qsEncode
public static final java.lang.String qsEncode(java.lang.String plainText)
Encodes the specified string encoded in "query string" format.
- Parameters:
theString
- the string to encode
- Returns:
- the encoded string
qsDecode
public static final java.lang.String qsDecode(java.lang.String theCipher)
Decodes a "query string".
- Parameters:
theCipher
- the string to decode
- Returns:
- the decoded string
b64Encode
public static final java.lang.String b64Encode(java.lang.String plainText)
Encodes the specified string in base 64.
- Parameters:
plainText
- the string to encode
- Returns:
- the encoded string
b64Decode
public static final java.lang.String b64Decode(java.lang.String theCipher)
Decodes a base 64 string.
- Parameters:
theCipher
- the string to decode
- Returns:
- the decoded string
b64Decode
public static final byte[] b64Decode(byte theCipherArr[])
Decodes a base 64 byte[]
- Parameters:
theCipherArr
- the byte[] to decode
- Returns:
- the decoded byte[]