@Internal public final class HexDump extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EOL |
static java.nio.charset.Charset |
UTF8 |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
byteToHex(int value) |
static java.lang.String |
dump(byte[] data, long offset, int index)
dump an array of bytes to a String
(将字节数组转储到字符串)
|
static java.lang.String |
dump(byte[] data, long offset, int index, int length)
dump an array of bytes to a String
(将字节数组转储到字符串)
|
static void |
dump(byte[] data, long offset, java.io.OutputStream stream, int index)
dump an array of bytes to an OutputStream
(将字节数组转储到 OutputStream)
|
static void |
dump(byte[] data, long offset, java.io.OutputStream stream, int index, int length)
dump an array of bytes to an OutputStream
(将字节数组转储到 OutputStream)
|
static java.lang.String |
intToHex(int value) |
static java.lang.String |
longToHex(long value) |
static java.lang.String |
shortToHex(int value) |
static char |
toAscii(int dataB) |
static java.lang.String |
toHex(byte value)
Converts the parameter to a hex value.
(将参数转换为十六进制值。)
|
static java.lang.String |
toHex(byte[] value)
Converts the parameter to a hex value.
(将参数转换为十六进制值。)
|
static java.lang.String |
toHex(int value)
Converts the parameter to a hex value.
(将参数转换为十六进制值。)
|
static java.lang.String |
toHex(long value)
Converts the parameter to a hex value.
(将参数转换为十六进制值。)
|
static java.lang.String |
toHex(short value)
Converts the parameter to a hex value.
(将参数转换为十六进制值。)
|
public static final java.lang.String EOL
public static final java.nio.charset.Charset UTF8
public static void dump(byte[] data, long offset, java.io.OutputStream stream, int index, int length) throws java.io.IOException, java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
data
- the byte array to be dumped
(data - 要转储的字节数组)
offset
- its offset, whatever that might mean
(offset - 它的偏移量,无论这可能意味着什么)
stream
- the OutputStream to which the data is to be written
(stream - 要写入数据的 OutputStream)
index
- initial index into the byte array
(index - 字节数组的初始索引)
length
- number of characters to output
(length - 要输出的字符数)
java.io.IOException
- is thrown if anything goes wrong writing the data to stream
(java.io.IOException - 如果将数据写入流中出现任何问题,则抛出)
java.lang.ArrayIndexOutOfBoundsException
- if the index is outside the data array's bounds
(java.lang.ArrayIndexOutOfBoundsException - 如果索引超出数据数组的范围)
java.lang.IllegalArgumentException
- if the output stream is null
(java.lang.IllegalArgumentException - 如果输出流为空)
public static void dump(byte[] data, long offset, java.io.OutputStream stream, int index) throws java.io.IOException, java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
data
- the byte array to be dumped
(data - 要转储的字节数组)
offset
- its offset, whatever that might mean
(offset - 它的偏移量,无论这可能意味着什么)
stream
- the OutputStream to which the data is to be written
(stream - 要写入数据的 OutputStream)
index
- initial index into the byte array
(index - 字节数组的初始索引)
java.io.IOException
- is thrown if anything goes wrong writing the data to stream
(java.io.IOException - 如果将数据写入流中出现任何问题,则抛出)
java.lang.ArrayIndexOutOfBoundsException
- if the index is outside the data array's bounds
(java.lang.ArrayIndexOutOfBoundsException - 如果索引超出数据数组的范围)
java.lang.IllegalArgumentException
- if the output stream is null
(java.lang.IllegalArgumentException - 如果输出流为空)
public static java.lang.String dump(byte[] data, long offset, int index)
data
- the byte array to be dumped
(data - 要转储的字节数组)
offset
- its offset, whatever that might mean
(offset - 它的偏移量,无论这可能意味着什么)
index
- initial index into the byte array
(index - 字节数组的初始索引)
java.lang.ArrayIndexOutOfBoundsException
- if the index is outside the data array's bounds
(java.lang.ArrayIndexOutOfBoundsException - 如果索引超出数据数组的范围)
public static java.lang.String dump(byte[] data, long offset, int index, int length)
data
- the byte array to be dumped
(data - 要转储的字节数组)
offset
- its offset, whatever that might mean
(offset - 它的偏移量,无论这可能意味着什么)
index
- initial index into the byte array
(index - 字节数组的初始索引)
length
- number of characters to output
(length - 要输出的字符数)
java.lang.ArrayIndexOutOfBoundsException
- if the index is outside the data array's bounds
(java.lang.ArrayIndexOutOfBoundsException - 如果索引超出数据数组的范围)
public static char toAscii(int dataB)
public static java.lang.String toHex(byte[] value)
value
- The value to convert
(value - 要转换的值)
public static java.lang.String toHex(short value)
value
- The value to convert
(value - 要转换的值)
public static java.lang.String toHex(byte value)
value
- The value to convert
(value - 要转换的值)
public static java.lang.String toHex(int value)
value
- The value to convert
(value - 要转换的值)
public static java.lang.String toHex(long value)
value
- The value to convert
(value - 要转换的值)
public static java.lang.String longToHex(long value)
public static java.lang.String intToHex(int value)
public static java.lang.String shortToHex(int value)
public static java.lang.String byteToHex(int value)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.