|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.util.HexDump
public class HexDump
dump data in hexadecimal format; derived from a HexDump utility I wrote in June 2001.
Field Summary | |
---|---|
static java.lang.String |
EOL
|
Method Summary | |
---|---|
static char[] |
byteToHex(int value)
|
static java.lang.String |
dump(byte[] data,
long offset,
int index)
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 void |
dump(java.io.InputStream in,
java.io.PrintStream out,
int start,
int bytesToDump)
Dumps bytesToDump bytes to an output stream. |
static char[] |
intToHex(int value)
|
static char[] |
longToHex(long value)
|
static void |
main(java.lang.String[] args)
|
static char[] |
shortToHex(int value)
|
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(byte[] value,
int bytesPerLine)
Converts the parameter to a hex value breaking the results into lines. |
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. |
static java.lang.String |
toHex(short[] value)
Converts the parameter to a hex value. |
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
Method Detail |
---|
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 output
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
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 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
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 array
java.lang.ArrayIndexOutOfBoundsException
- if the index is
outside the data array's boundspublic static java.lang.String toHex(byte[] value)
value
- The value to convert
public static java.lang.String toHex(short[] value)
value
- The value to convert
public static java.lang.String toHex(byte[] value, int bytesPerLine)
Converts the parameter to a hex value breaking the results into lines.
value
- The value to convertbytesPerLine
- The maximum number of bytes per line. The next byte
will be written to a new line
public static java.lang.String toHex(short value)
value
- The value to convert
public static java.lang.String toHex(byte value)
value
- The value to convert
public static java.lang.String toHex(int value)
value
- The value to convert
public static java.lang.String toHex(long value)
value
- The value to convert
public static void dump(java.io.InputStream in, java.io.PrintStream out, int start, int bytesToDump) throws java.io.IOException
bytesToDump
bytes to an output stream.
in
- The stream to read fromout
- The output streamstart
- The index to use as the starting position for the left hand side labelbytesToDump
- The number of bytes to output. Use -1 to read until the end of file.
java.io.IOException
public static char[] longToHex(long value)
public static char[] intToHex(int value)
public static char[] shortToHex(int value)
public static char[] byteToHex(int value)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |