org.apache.commons.io
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.
Version: $Id: HexDump.java 437680 2006-08-28 11:57:00Z scolebourne $
Field Summary | |
---|---|
static String | EOL
The line-separator (initializes to "line.separator" system property. |
static StringBuffer | _cbuffer |
static char[] | _hexcodes |
static StringBuffer | _lbuffer |
static int[] | _shifts |
Constructor Summary | |
---|---|
HexDump()
Instances should NOT be constructed in standard programming. |
Method Summary | |
---|---|
static void | dump(byte[] data, long offset, OutputStream stream, int index)
Dump an array of bytes to an OutputStream.
|
static StringBuffer | dump(long value)
Dump a long value into a StringBuffer.
|
static StringBuffer | dump(byte value)
Dump a byte value into a StringBuffer.
|
Parameters: data the byte array to be dumped offset its offset, whatever that might mean stream the OutputStream to which the data is to be written index initial index into the byte array
Throws: IOException is thrown if anything goes wrong writing the data to stream ArrayIndexOutOfBoundsException if the index is outside the data array's bounds IllegalArgumentException if the output stream is null
Parameters: value the long value to be dumped
Returns: StringBuffer containing the dumped value.
Parameters: value the byte value to be dumped
Returns: StringBuffer containing the dumped value.