Package com.tivoli.am.fim.base64
Class BASE64Utility
- java.lang.Object
-
- com.tivoli.am.fim.base64.BASE64Utility
-
public final class BASE64Utility extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
decode(byte[] in)
This method extracts the bytes of the String into a byte array using the UTF-8 character encoding.static byte[]
decode(java.lang.String in)
This method extracts the bytes of the String into a byte array using the UTF-8 character encoding.static java.lang.String
encode(byte[] in)
Reads the input array and returns the base 64 encoding of the bytes that are in the byte array.static java.lang.String
encode(byte[] in, boolean crlf76)
Reads the input array and returns the base 64 encoding of the bytes that are in the byte array.
-
-
-
Method Detail
-
decode
public static byte[] decode(byte[] in) throws java.io.IOException
This method extracts the bytes of the String into a byte array using the UTF-8 character encoding. The byte array is then decoded in accordance with the Base 64 RFC2045 and a byte array of the decoded bytes is returned.- Parameters:
in
- The string to decode in accordance with the Base 64 RFC2045.- Returns:
- The base 64 decoding of the bytes that are read off the stream.
- Throws:
java.io.IOException
- If an error occurs while reading off the stream.
-
decode
public static byte[] decode(java.lang.String in) throws java.io.IOException
This method extracts the bytes of the String into a byte array using the UTF-8 character encoding. The byte array is then decoded in accordance with the Base 64 RFC2045 and a byte array of the decoded bytes is returned.- Parameters:
in
- The string to decode in accordance with the Base 64 RFC2045.- Returns:
- The base 64 decoding of the bytes that are read off the stream.
- Throws:
java.io.IOException
- If an error occurs while reading off the stream.
-
encode
public static java.lang.String encode(byte[] in, boolean crlf76) throws java.io.IOException
Reads the input array and returns the base 64 encoding of the bytes that are in the byte array.- Parameters:
in
- Array of bytes to be encoded.crlf76
- A value oftrue
indicates that a carriage-return and line-feed (0x000D 0x000A) pair are written at 76 byte intervals as specified by the MIME Part one RFC2045. A value offalse
indicates that no carriage-return line-feed pair are in the base 64 encoding result.- Returns:
- The base 64 encoding of the bytes that are read off the stream.
- Throws:
java.io.IOException
- If an error occurs while reading off the stream.
-
encode
public static java.lang.String encode(byte[] in) throws java.io.IOException
Reads the input array and returns the base 64 encoding of the bytes that are in the byte array. By default, CRLF characters are inserted in the output at 76 byte intervals in accordnce with RFC2045.- Parameters:
in
- Array of bytes to be encoded.- Returns:
- The base 64 encoding of the bytes that are read off the stream.
- Throws:
java.io.IOException
- If an error occurs while reading off the stream.
-
-