@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
|
static void |
dump(byte[] data,
long offset,
java.io.OutputStream stream,
int index,
int length)
dump an array of bytes to an 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 dumpedoffset
- its offset, whatever that might meanstream
- the OutputStream to which the data is to be
writtenindex
- initial index into the byte arraylength
- number of characters to outputjava.io.IOException
- is thrown if anything goes wrong writing
the data to streamjava.lang.ArrayIndexOutOfBoundsException
- if the index is
outside the data array's boundsjava.lang.IllegalArgumentException
- if the output stream is
nullpublic 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 dumpedoffset
- its offset, whatever that might meanstream
- the OutputStream to which the data is to be
writtenindex
- initial index into the byte arrayjava.io.IOException
- is thrown if anything goes wrong writing
the data to streamjava.lang.ArrayIndexOutOfBoundsException
- if the index is
outside the data array's boundsjava.lang.IllegalArgumentException
- if the output stream is
nullpublic static java.lang.String dump(byte[] data, long offset, int index)
data
- the byte array to be dumpedoffset
- its offset, whatever that might meanindex
- initial index into the byte arrayjava.lang.ArrayIndexOutOfBoundsException
- if the index is
outside the data array's boundspublic static java.lang.String dump(byte[] data, long offset, int index, int length)
data
- the byte array to be dumpedoffset
- its offset, whatever that might meanindex
- initial index into the byte arraylength
- number of characters to outputjava.lang.ArrayIndexOutOfBoundsException
- if the index is
outside the data array's boundspublic static char toAscii(int dataB)
public static java.lang.String toHex(byte[] value)
value
- The value to convertpublic static java.lang.String toHex(short value)
value
- The value to convertpublic static java.lang.String toHex(byte value)
value
- The value to convertpublic static java.lang.String toHex(int value)
value
- The value to convertpublic static java.lang.String toHex(long value)
value
- The value to convertpublic 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 2022 The Apache Software Foundation or its licensors, as applicable.