|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.knowcenter.wag.egov.egiz.tools.CodingHelper
public class CodingHelper
This class provides encoding and decoding methods and other coding methods. All methods are static!
| Constructor Summary | |
|---|---|
CodingHelper()
|
|
| Method Summary | |
|---|---|
static byte[] |
buildDigest(byte[] data)
This method builds an SHA-1 hash value of a given byte array. |
static byte[] |
decodeBase64(byte[] ba)
This method decodes a given Base64 byte array |
static byte[] |
decodeBase64(String theString)
This method decodes a given Base64 string. |
static String |
decodeUTF8FromBase64(String encoded_string)
This method decodes the UTF-8 bytes from a Base64 US-ASCII (Java) String and decodes the UTF-8 bytes to a unicode (Java) String. |
static String |
encodeBase64(byte[] plainString)
This method encodes a given byte array Base64 |
static String |
encodeUTF8AsBase64(String plain_string)
This method encodes a given Unicode (Java) String to UTF-8 bytes and then encodes these UTF-8 bytes to a Base64 US-ASCII (Java) String. |
static String |
htmlEscape(String rawString)
This method escapes a given string with HTML entities. |
static boolean |
isB64(byte[] byteArray)
This method checks, if a byte array contains chars that are not base64 conform. |
static boolean |
isB64(String string)
This method checks, if a string contains chars that are not base64 conform. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CodingHelper()
| Method Detail |
|---|
public static String encodeUTF8AsBase64(String plain_string)
plain_string - to be encoded
public static String decodeUTF8FromBase64(String encoded_string)
encoded_string - to be decoded
public static byte[] decodeBase64(String theString)
Note that the given String must only contain Base64 characters. (The string will be converted to a byte array of "US-ASCII" (7 bit) bytes and then this byte array will be decoded using the Base64 algorithm.
theString - to be decoded
public static byte[] decodeBase64(byte[] ba)
ba - the byte array to be decoded
public static String encodeBase64(byte[] plainString)
plainString - the byte array to be encoded
public static byte[] buildDigest(byte[] data)
data - the byte array to build the hash value for
MessageDigestpublic static String htmlEscape(String rawString)
rawString - the string to escaped
public static boolean isB64(byte[] byteArray)
byteArray - the array to test
public static boolean isB64(String string)
string - the chars to test
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||