public final class Conversion
extends java.lang.Object
Only small amounts of data should be converted using this class, to write a large number of bytes as a Base64 String, an alternative method such as IAIK's Base64OutputStream should be used, or javax.mail.internet.MimeUtility.
Modifier and Type | Method and Description |
---|---|
static byte[] |
base64StringToByteArray(java.lang.String s)
Deprecated.
since 3.10, use
Base64 instead. |
static java.lang.String |
byteArrayToBase64String(byte[] b)
Deprecated.
since 3.10, use
Base64 instead. |
static java.lang.String |
byteArrayToBase64String(byte[] b,
int len)
Deprecated.
since 3.10, use
Base64 instead. |
static java.lang.String |
byteArrayToHexString(byte[] b)
Convert a byte array to a hexadecimal String.
|
static java.lang.String |
byteToHexString(byte b)
Convert a byte to a hexadecimal String.
|
static byte[] |
hexStringToByteArray(java.lang.String s)
Parses the supplied String into a byte[] - assumes that the text is in hex
format.
|
public static java.lang.String byteToHexString(byte b)
b
- a single bytepublic static java.lang.String byteArrayToHexString(byte[] b)
b
- the bytes@Deprecated public static java.lang.String byteArrayToBase64String(byte[] b, int len)
Base64
instead.b
- the byteslen
- the length@Deprecated public static java.lang.String byteArrayToBase64String(byte[] b)
Base64
instead.b
- the bytes@Deprecated public static byte[] base64StringToByteArray(java.lang.String s) throws java.lang.NumberFormatException
Base64
instead.s
- the stringjava.lang.NumberFormatException
- if the stirng is invalid base64public static byte[] hexStringToByteArray(java.lang.String s) throws java.io.IOException
s
- the hex Stringjava.io.IOException