|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bristle.javalib.util.Base64
public class Base64
This class contains support for Base64 encoding and decoding.
Usage: - The typical scenario for using this class is: - To encode a string as Base64: String strEncoded = Base64.encode(strDecoded); - To decode a Base64 string: String strDecoded = Base64.decode(strEncoded); - See the source code of the inner Tester class for more examples. Assumptions: Effects: - None. Anticipated Changes: Notes: Implementation Notes: Portability Issues: Revision History: $Log$
Nested Class Summary | |
---|---|
static class |
Base64.InvalidBase64DigitException
This exception is thrown when an invalid character is found as a digit in a Base64 encoded string that is being decoded. |
static class |
Base64.Tester
Each class contains a Tester inner class with a main() for easier unit testing. |
static class |
Base64.TruncatedBase64EncodingException
This exception is thrown when a Base64 encoded string that is being decoded has an invalid length, or has a trailing Base64 digit that implies that there should be more digits. |
Constructor Summary | |
---|---|
Base64()
|
Method Summary | |
---|---|
static String |
decode(String strIn)
Return the decoded string value of the specified Base64 encoded string. |
static String |
encode(String strIn)
Return the Base64 encoded string value of the specified string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Base64()
Method Detail |
---|
public static String encode(String strIn) throws UnsupportedEncodingException
strIn
- String to be encoded.
UnsupportedEncodingException
- When the incoming string does not use the
ISO-8859-1 (Latin-1) encoding.public static String decode(String strIn) throws UnsupportedEncodingException, Base64.InvalidBase64DigitException, Base64.TruncatedBase64EncodingException
strIn
- String to be decoded.
UnsupportedEncodingException
- When the incoming string does not use the
ISO-8859-1 (Latin-1) encoding.
Base64.InvalidBase64DigitException
- When the string to be decoded contains a character
that is not a valid Base64 digit char.
Base64.TruncatedBase64EncodingException
- When the string to be decoded has an invalid
length.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |