Package com.tivoli.am.fim.base64
Class BASE64Utility
java.lang.Object
com.tivoli.am.fim.base64.BASE64Utility
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
decode
(byte[] in) This method extracts the bytes of the String into a byte array using the UTF-8 character encoding.static byte[]
This method extracts the bytes of the String into a byte array using the UTF-8 character encoding.static String
encode
(byte[] in) Reads the input array and returns the base 64 encoding of the bytes that are in the byte array.static 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 Details
-
decode
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:
IOException
- If an error occurs while reading off the stream.
-
decode
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:
IOException
- If an error occurs while reading off the stream.
-
encode
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:
IOException
- If an error occurs while reading off the stream.
-
encode
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:
IOException
- If an error occurs while reading off the stream.
-