|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.util.type.CodecUtil
public final class CodecUtil
The CodecUtil contains methods for encode and decode operations.
| Method Summary | |
|---|---|
static String |
decodeHex(String pHex)
Decodes a hex, utf-8 encoded text to a string. |
static byte[] |
decodeHexAsBytes(String pHex)
Decodes a hex, utf-8 encoded text to a string. |
static String |
decodeHtml(String pHtml)
Encodes raw html to text. |
static String |
decodeURLParameter(String pValue)
Decodes an encoded value from an URL query parameter with ISO-8859-1. |
static String |
decodeURLParameter(String pValue,
String pEncoding)
Decodes an encoded value from an URL query parameter with a specific charset. |
static String |
decodeURLPart(String pURL)
Decodes the part of an URL with UTF-8. |
static String |
encodeHex(byte[] pContent)
Encodes a list of bytes to a hex encoded string. |
static String |
encodeHex(InputStream pStream)
Encodes a stream to a hex encoded string. |
static String |
encodeHex(String pText)
Encodes a text to a hex encoded string. |
static String |
encodeHtml(String pText)
Encodes a text to raw html. |
static String |
encodeURLParameter(String pValue)
Encodes a plain value for an URL query parameter with ISO-8859-1. |
static String |
encodeURLParameter(String pValue,
String pEncoding)
Encodes a plain value for an URL query parameter with a specific charset. |
static String |
encodeURLPart(String pPart)
Encodes the part for an URL with UTF-8 encoding. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String encodeURLPart(String pPart)
pPart - the url part
public static String encodeURLParameter(String pValue)
pValue - the plain query parameter value
null if ISO-8859-1 is not supported
public static String encodeURLParameter(String pValue,
String pEncoding)
pValue - the plain query parameter valuepEncoding - the charset e.g. UTF-8
null if pEncoding is not supportedpublic static String decodeURLPart(String pURL)
pURL - the url part
public static String decodeURLParameter(String pValue)
pValue - the encoded query parameter value
null if ISO-8859-1 is not supported
public static String decodeURLParameter(String pValue,
String pEncoding)
pValue - the encoded query parameter valuepEncoding - the charset e.g. UTF-8
null if pEncoding is not supportedpublic static String encodeHtml(String pText)
pText - the text
public static String decodeHtml(String pHtml)
pHtml - the html code
public static String encodeHex(String pText)
throws UnsupportedEncodingException
pText - the plain text
UnsupportedEncodingException - if utf-8 encoding is not supportedpublic static String encodeHex(byte[] pContent)
pContent - the list of bytes
public static String encodeHex(InputStream pStream)
throws IOException
pStream - the stream
IOException - if stream reading fails
public static String decodeHex(String pHex)
throws UnsupportedEncodingException
pHex - the decoded text
UnsupportedEncodingException - if utf-8 encoding is not supported
public static byte[] decodeHexAsBytes(String pHex)
throws UnsupportedEncodingException
pHex - the decoded text
UnsupportedEncodingException - if utf-8 encoding is not supported
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||