Package sunlabs.brazil.util
Class Base64
java.lang.Object
sunlabs.brazil.util.Base64
Utility to base64 encode and decode a string.
- Version:
- 2.3
- Author:
- Stephen Uhler
-
Method Summary
-
Method Details
-
encode
base-64 encode a string- Parameters:
s
- The ascii string to encode- Returns:
- The base64 encoded result
-
encode
base-64 encode a byte array- Parameters:
src
- The byte array to encode- Returns:
- The base64 encoded result
-
encode
base-64 encode a byte array- Parameters:
src
- The byte array to encodestart
- The starting indexlen
- The number of bytes- Returns:
- The base64 encoded result
-
decode
A Base64 decoder. This implementation is slow, and doesn't handle wrapped lines. The output is undefined if there are errors in the input.- Parameters:
s
- a Base64 encoded string- Returns:
- The byte array eith the decoded result
-
main
Test the decoder and encoder. Call asBase64 [string]
.
-