public class HexDump extends Object
Provides a single function to take an array of bytes and display it in hexadecimal form.
Origin of code: POI.
public static final String EOL
public static void dump(byte[] data,
long offset,
OutputStream stream,
int index)
throws IOException,
ArrayIndexOutOfBoundsException,
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 arrayIOException - is thrown if anything goes wrong writing
the data to streamArrayIndexOutOfBoundsException - if the index is
outside the data array's boundsIllegalArgumentException - if the output stream is null