Package pixy.string
Class Base64
java.lang.Object
pixy.string.Base64
public final class Base64
extends java.lang.Object
A simple base64 encoding and decoding utility class. It can also
encode and decode non ASII characters such as Chinese.
Changed decode method to remove potential problem when decoding concatenated encoded strings.
- Version:
- 1.01 04/18/2012
- Author:
- Wen Yu, yuwen_66@yahoo.com
-
Constructor Summary
Constructors Constructor Description Base64()
-
Method Summary
Modifier and Type Method Description static java.lang.String
decode(java.lang.String s)
static byte[]
decodeToByteArray(java.lang.String s)
static java.lang.String
encode(byte[] buf)
static java.lang.String
encode(java.lang.String s)
-
Constructor Details
-
Base64
public Base64()
-
-
Method Details
-
encode
public static java.lang.String encode(java.lang.String s) -
encode
public static java.lang.String encode(byte[] buf) -
decode
public static java.lang.String decode(java.lang.String s) throws java.lang.Exception- Throws:
java.lang.Exception
-
decodeToByteArray
public static byte[] decodeToByteArray(java.lang.String s) throws java.lang.Exception- Throws:
java.lang.Exception
-