Package org.xbill.DNS.utils
Class base64
java.lang.Object
org.xbill.DNS.utils.base64
Routines for converting between Strings of base64-encoded data and arrays of binary data.
- Author:
- Brian Wellington
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatString(byte[] b, int lineLength, String prefix, boolean addClose) Formats data into a nicely formatted base64 encoded Stringstatic byte[]fromString(String str) Convert a base64-encoded String to binary datastatic StringtoString(byte[] b) Convert binary data to a base64-encoded Stringstatic StringtoString(byte[] b, boolean useUrl) Convert binary data to a base64-encoded String
-
Method Details
-
toString
Convert binary data to a base64-encoded String- Parameters:
b- An array containing binary data- Returns:
- A String containing the encoded data
-
toString
Convert binary data to a base64-encoded String- Parameters:
b- An array containing binary datauseUrl- True to use Base64URL encoding (i.e. no trailing =, -_ instead of +/)- Returns:
- A String containing the encoded data
-
formatString
Formats data into a nicely formatted base64 encoded String- Parameters:
b- An array containing binary datalineLength- The number of characters per lineprefix- A string prefixing the characters on each lineaddClose- Whether to add a close parenthesis or not- Returns:
- A String representing the formatted output
-
fromString
Convert a base64-encoded String to binary data- Parameters:
str- A String containing the encoded data- Returns:
- An array containing the binary data, or null if the string is invalid
-