Package org.avaje.freemarker.util
Class EncodeUtil
- java.lang.Object
-
- org.avaje.freemarker.util.EncodeUtil
-
public final class EncodeUtil extends Object
Utilities for encoding and decoding strings.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]asciiToBytes(String string)Returns the bytes corresponding to the specified ASCII string.static StringbytesToAscii(byte[] data)Returns the ASCII string corresponding to the specified bytes.static StringbytesToUtf8(byte[] data)Returns the UTF-8 string corresponding to the specified bytes.static StringdecodeBytes(byte[] data, String encoding)Returns the UTF-8 string corresponding to the specified bytes.static StringurlDecode(String string)URL-decodes the specified string as a UTF-8 string.static StringurlEncode(String string)URL-encodes the specified UTF-8 string.static byte[]utf8ToBytes(String string)Returns the bytes corresponding to the specified UTF-8 string.
-
-
-
Method Detail
-
urlDecode
public static String urlDecode(String string)
URL-decodes the specified string as a UTF-8 string.
-
asciiToBytes
public static byte[] asciiToBytes(String string)
Returns the bytes corresponding to the specified ASCII string.
-
bytesToAscii
public static String bytesToAscii(byte[] data)
Returns the ASCII string corresponding to the specified bytes.
-
utf8ToBytes
public static byte[] utf8ToBytes(String string)
Returns the bytes corresponding to the specified UTF-8 string.
-
bytesToUtf8
public static String bytesToUtf8(byte[] data)
Returns the UTF-8 string corresponding to the specified bytes.
-
decodeBytes
public static String decodeBytes(byte[] data, String encoding)
Returns the UTF-8 string corresponding to the specified bytes.
-
-