Package org.xbill.DNS.utils
Class base16
java.lang.Object
org.xbill.DNS.utils.base16
Routines for converting between Strings of hex-encoded data and arrays of binary data. This is
not actually used by DNS.
- Author:
- Brian Wellington
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]fromString(String str) Convert a hex-encoded String to binary data, ignoringwhitespacecharacters.static StringtoString(byte[] b) Convert binary data to a hex-encoded Stringstatic StringConvert binary data to a hex-encoded string, line-wrapped atlineLengthcharacters.
-
Method Details
-
toString
Convert binary data to a hex-encoded String- Parameters:
b- An array containing binary data- Returns:
- A String containing the encoded data
-
toString
Convert binary data to a hex-encoded string, line-wrapped atlineLengthcharacters.- 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 containing the encoded data
- Since:
- 3.6
-
fromString
Convert a hex-encoded String to binary data, ignoringwhitespacecharacters.Returns
null- when
strisnull, - when non-hex digits or non-whitespace characters are encountered.
- Parameters:
str- A String containing the encoded data.- Returns:
- An array containing the binary data, or null if the string is invalid.
- when
-