org.apache.commons.io
public class HexDump extends java.lang.Object
Provides a single function to take an array of bytes and display it in hexadecimal form.
Origin of code: POI.
Modifier and Type | Field and Description |
---|---|
private static char[] |
_hexcodes |
private static int[] |
_shifts |
static java.lang.String |
EOL
The line-separator (initializes to "line.separator" system property.
|
Constructor and Description |
---|
HexDump()
Instances should NOT be constructed in standard programming.
|
Modifier and Type | Method and Description |
---|---|
static void |
dump(byte[] data,
long offset,
java.io.OutputStream stream,
int index)
Dump an array of bytes to an OutputStream.
|
private static java.lang.StringBuffer |
dump(java.lang.StringBuffer _cbuffer,
byte value)
Dump a byte value into a StringBuffer.
|
private static java.lang.StringBuffer |
dump(java.lang.StringBuffer _lbuffer,
long value)
Dump a long value into a StringBuffer.
|
public static final java.lang.String EOL
private static final char[] _hexcodes
private static final int[] _shifts
public HexDump()
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 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 nullprivate static java.lang.StringBuffer dump(java.lang.StringBuffer _lbuffer, long value)
_lbuffer
- the StringBuffer to dump the value invalue
- the long value to be dumpedprivate static java.lang.StringBuffer dump(java.lang.StringBuffer _cbuffer, byte value)
_cbuffer
- the StringBuffer to dump the value invalue
- the byte value to be dumpedCopyright (c) 2002-2014 Apache Software Foundation