Package hec.util
Class Base64
java.lang.Object
hec.util.Base64
Class for base64 encoding/decoding
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
decode
(byte[] in) Base64 decodes an array of bytesstatic byte[]
decode
(byte[] in, int offset, int len) Base64 decodes an array of bytesstatic String
Base64 decodes a string, which is interpreted according to the ISO-8859-1 character setstatic String
Base64 decodes a string, which is interpreted according to the specified character setstatic byte[]
encode
(byte[] in) Base64 encodes an array of bytesstatic byte[]
encode
(byte[] in, int offset, int len) Base64 encodes an array of bytesstatic String
Base64 encodes a string, which is interpreted according to the ISO-8859-1 character setstatic String
Base64 encodes a string, which is interpreted according to the specified character set
-
Constructor Details
-
Base64
public Base64()
-
-
Method Details
-
encode
Base64 encodes a string, which is interpreted according to the ISO-8859-1 character set- Parameters:
str
- The string to encode- Returns:
- The encoded string, generated with the ISO-8859-1 character set
- Throws:
UnsupportedEncodingException
-
encode
Base64 encodes a string, which is interpreted according to the specified character set- Parameters:
str
- The string to encodecharset
- The character set to interpret the string with- Returns:
- The encoded string, generated with the specified character set
- Throws:
UnsupportedEncodingException
-
decode
Base64 decodes a string, which is interpreted according to the ISO-8859-1 character set- Parameters:
str
- The string to encode- Returns:
- The decoded string, generated with the ISO-8859-1 character set
- Throws:
UnsupportedEncodingException
-
decode
Base64 decodes a string, which is interpreted according to the specified character set- Parameters:
str
- The string to encodecharset
- The character set to interpret the string with- Returns:
- The decoded string, generated with the specified character set
- Throws:
UnsupportedEncodingException
-
encode
public static byte[] encode(byte[] in, int offset, int len) Base64 encodes an array of bytes- Parameters:
in
- The array of bytes to encodeoffset
- The starting offset into the array to encodelen
- The number of bytes to encode- Returns:
- The encoded bytes
-
encode
public static byte[] encode(byte[] in) Base64 encodes an array of bytes- Parameters:
in
- The array of bytes to encode- Returns:
- The encoded bytes
-
decode
public static byte[] decode(byte[] in, int offset, int len) Base64 decodes an array of bytes- Parameters:
in
- The array of bytes to decodeoffset
- The starting offset into the array to decodelen
- The number of bytes to decode- Returns:
- The decoded bytes
-
decode
public static byte[] decode(byte[] in) Base64 decodes an array of bytes- Parameters:
in
- The array of bytes to decode- Returns:
- The decoded bytes
-