org.apache.poi.util
Class HexDump
java.lang.Object
|
+--org.apache.poi.util.HexDump
- public class HexDump
- extends java.lang.Object
dump data in hexadecimal format; derived from a HexDump utility I
wrote in June 2001.
- Author:
- Marc Johnson, Glen Stampoultzis (glens at apache.org)
Field Summary |
static java.lang.String |
EOL
|
Method Summary |
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 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(int 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 |
EOL
public static final java.lang.String EOL
dump
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
- dump an array of bytes to an OutputStream
- Parameters:
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- Throws:
java.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
null
dump
public static void dump(byte[] data,
long offset,
java.io.OutputStream stream,
int index)
throws java.io.IOException,
java.lang.ArrayIndexOutOfBoundsException,
java.lang.IllegalArgumentException
- dump an array of bytes to an OutputStream
- Parameters:
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- Throws:
java.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
null
toHex
public static java.lang.String toHex(byte[] value)
- Converts the parameter to a hex value.
- Parameters:
value
- The value to convert- Returns:
- A String representing the array of bytes
toHex
public static java.lang.String toHex(short value)
- Converts the parameter to a hex value.
- Parameters:
value
- The value to convert- Returns:
- The result right padded with 0
toHex
public static java.lang.String toHex(byte value)
- Converts the parameter to a hex value.
- Parameters:
value
- The value to convert- Returns:
- The result right padded with 0
toHex
public static java.lang.String toHex(int value)
- Converts the parameter to a hex value.
- Parameters:
value
- The value to convert- Returns:
- The result right padded with 0
Copyright © 2002 Apache jakarta-poi project. All Rights Reserved.