public class Hex
extends java.lang.Object
| 限定符和类型 | 方法和说明 |
|---|---|
static java.lang.String |
addPrefix(java.lang.String data) |
static byte[] |
decode(byte[] data)
decode the Hex encoded input data.
|
static byte[] |
decode(java.lang.String data)
decode the Hex encoded String data - whitespace will be ignored.
|
static int |
decode(java.lang.String data,
java.io.OutputStream out)
decode the Hex encoded String data writing it to the given output stream, whitespace
characters will be ignored.
|
static byte[] |
encode(byte[] data)
encode the input data producing a Hex encoded byte array.
|
static byte[] |
encode(byte[] data,
int off,
int length)
encode the input data producing a Hex encoded byte array.
|
static int |
encode(byte[] data,
int off,
int length,
java.io.OutputStream out)
Hex encode the byte data writing it to the given output stream.
|
static int |
encode(byte[] data,
java.io.OutputStream out)
Hex encode the byte data writing it to the given output stream.
|
static boolean |
hasHexPrefix(java.lang.String data) |
static java.lang.String |
toHexString(byte[] data) |
static java.lang.String |
toHexString(byte[] data,
int off,
int length) |
static java.lang.String |
toHexStringWithPrefix(byte[] data) |
static java.lang.String |
trimPrefix(java.lang.String data) |
public static boolean hasHexPrefix(java.lang.String data)
public static java.lang.String addPrefix(java.lang.String data)
public static java.lang.String trimPrefix(java.lang.String data)
public static java.lang.String toHexStringWithPrefix(byte[] data)
public static java.lang.String toHexString(byte[] data)
public static java.lang.String toHexString(byte[] data,
int off,
int length)
public static byte[] encode(byte[] data)
data - the input datapublic static byte[] encode(byte[] data,
int off,
int length)
data - the input byte arrayoff - the offset of the data to be convertedlength - the length of the data to be convertedpublic static int encode(byte[] data,
java.io.OutputStream out)
throws java.io.IOException
data - the byte arrayout - the output streamjava.io.IOException - the I/O exceptionpublic static int encode(byte[] data,
int off,
int length,
java.io.OutputStream out)
throws java.io.IOException
data - the byte arrayoff - the offset of the data to be convertedlength - the length of the data to be convertedout - the output streamjava.io.IOException - the I/O exceptionpublic static byte[] decode(byte[] data)
data - the input byte arraypublic static byte[] decode(java.lang.String data)
data - the input byte arraypublic static int decode(java.lang.String data,
java.io.OutputStream out)
throws java.io.IOException
data - the input byte arrayout - the output streamjava.io.IOException - the I/O exception