Package org.jeegen.jee6.util
Class Base64
- java.lang.Object
-
- org.jeegen.jee6.util.Base64
-
public class Base64 extends Object
This class support encoding an decoding of BASE64 coder.
-
-
Constructor Summary
Constructors Constructor Description Base64()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
decode(String coded)
Translates the specified BASE64 string into a byte array.static String
encode(byte[] buffer)
This method encodes a byte array into BASE64.static String
encode(String input)
This method encodes a text into BASE64.
-
-
-
Method Detail
-
encode
public static String encode(String input) throws UnsupportedEncodingException
This method encodes a text into BASE64. The String is converted into an ISO 8859-1 encoded byte array.- Parameters:
input
- The text to encode.- Returns:
- The encoded text.
- Throws:
UnsupportedEncodingException
- on encoding error.
-
encode
public static String encode(byte[] buffer)
This method encodes a byte array into BASE64.- Parameters:
buffer
- The text to encode.- Returns:
- The encoded text.
-
decode
public static byte[] decode(String coded)
Translates the specified BASE64 string into a byte array.- Parameters:
coded
- The Base64 string (not null)- Returns:
- The byte array (not null)
-
-