|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.io.HexDump
public class HexDump
Dumps data in hexadecimal format.
Provides a single function to take an array of bytes and display it in hexadecimal form.
Origin of code: POI.
Field Summary | |
---|---|
private static char[] |
_hexcodes
|
private static int[] |
_shifts
|
static java.lang.String |
EOL
The line-separator (initializes to "line.separator" system property. |
Constructor Summary | |
---|---|
HexDump()
Instances should NOT be constructed in standard programming. |
Method Summary | |
---|---|
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.StringBuilder |
dump(java.lang.StringBuilder _cbuffer,
byte value)
Dump a byte value into a StringBuilder. |
private static java.lang.StringBuilder |
dump(java.lang.StringBuilder _lbuffer,
long value)
Dump a long value into a StringBuilder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String EOL
private static final char[] _hexcodes
private static final int[] _shifts
Constructor Detail |
---|
public HexDump()
Method Detail |
---|
public static void dump(byte[] data, long offset, java.io.OutputStream stream, int index) throws java.io.IOException, java.lang.ArrayIndexOutOfBoundsException, java.lang.IllegalArgumentException
The offset argument specifies the start offset of the data array within a larger entity like a file or an incoming stream. For example, if the data array contains the third kibibyte of a file, then the offset argument should be set to 2048. The offset value printed at the beginning of each line indicates where in that larger entity the first byte on that line is located.
All bytes between the given index (inclusive) and the end of the data array are dumped.
data
- the byte array to be dumpedoffset
- offset of the byte array within a larger entitystream
- the OutputStream to which the data is to be
writtenindex
- initial index into the byte array
java.io.IOException
- is thrown if anything goes wrong writing
the data to stream
java.lang.ArrayIndexOutOfBoundsException
- if the index is
outside the data array's bounds
java.lang.IllegalArgumentException
- if the output stream is nullprivate static java.lang.StringBuilder dump(java.lang.StringBuilder _lbuffer, long value)
_lbuffer
- the StringBuilder to dump the value invalue
- the long value to be dumped
private static java.lang.StringBuilder dump(java.lang.StringBuilder _cbuffer, byte value)
_cbuffer
- the StringBuilder to dump the value invalue
- the byte value to be dumped
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |