| java.lang.Object org.apache.poi.util.HexDump
HexDump | public class HexDump (Code) | | dump data in hexadecimal format; derived from a HexDump utility I
wrote in June 2001.
author: Marc Johnson author: Glen Stampoultzis (glens at apache.org) |
Method Summary | |
public static synchronized void | dump(byte[] data, long offset, OutputStream stream, int index, int length) | public static synchronized void | dump(byte[] data, long offset, OutputStream stream, int index) | public static String | dump(byte[] data, long offset, int index) | public static void | dump(InputStream in, PrintStream out, int start, int bytesToDump) Dumps bytesToDump bytes to an output stream.
Parameters: in - The stream to read from Parameters: out - The output stream Parameters: start - The index to use as the starting position for the left hand side label Parameters: bytesToDump - The number of bytes to output. | public static void | main(String[] args) | public static String | toHex(byte[] value) Converts the parameter to a hex value. | public static String | toHex(short[] value) Converts the parameter to a hex value. | public static String | toHex(byte[] value, int bytesPerLine) Converts the parameter to a hex value breaking the results into
lines.
Parameters: value - The value to convert Parameters: bytesPerLine - The maximum number of bytes per line. | public static String | toHex(short value) Converts the parameter to a hex value. | public static String | toHex(byte value) Converts the parameter to a hex value. | public static String | toHex(int value) Converts the parameter to a hex value. | public static String | toHex(long value) Converts the parameter to a hex value. |
dump | public static synchronized void dump(byte[] data, long offset, OutputStream stream, int index, int length) throws IOException, ArrayIndexOutOfBoundsException, IllegalArgumentException(Code) | | dump an array of bytes to an OutputStream
Parameters: data - the byte array to be dumped Parameters: offset - its offset, whatever that might mean Parameters: stream - the OutputStream to which the data is to bewritten Parameters: index - initial index into the byte array Parameters: length - number of characters to output exception: IOException - is thrown if anything goes wrong writingthe data to stream exception: ArrayIndexOutOfBoundsException - if the index isoutside the data array's bounds exception: IllegalArgumentException - if the output stream isnull |
dump | public static String dump(byte[] data, long offset, int index)(Code) | | dump an array of bytes to a String
Parameters: data - the byte array to be dumped Parameters: offset - its offset, whatever that might mean Parameters: index - initial index into the byte array exception: ArrayIndexOutOfBoundsException - if the index isoutside the data array's bounds output string |
dump | public static void dump(InputStream in, PrintStream out, int start, int bytesToDump) throws IOException(Code) | | Dumps bytesToDump bytes to an output stream.
Parameters: in - The stream to read from Parameters: out - The output stream Parameters: start - The index to use as the starting position for the left hand side label Parameters: bytesToDump - The number of bytes to output. Use -1 to read until the end of file. |
toHex | public static String toHex(byte[] value)(Code) | | Converts the parameter to a hex value.
Parameters: value - The value to convert A String representing the array of bytes |
toHex | public static String toHex(short[] value)(Code) | | Converts the parameter to a hex value.
Parameters: value - The value to convert A String representing the array of shorts |
toHex | public static String toHex(byte[] value, int bytesPerLine)(Code) | | Converts the parameter to a hex value breaking the results into
lines.
Parameters: value - The value to convert Parameters: bytesPerLine - The maximum number of bytes per line. The next bytewill be written to a new line A String representing the array of bytes |
toHex | public static String toHex(short value)(Code) | | Converts the parameter to a hex value.
Parameters: value - The value to convert The result right padded with 0 |
toHex | public static String toHex(byte value)(Code) | | Converts the parameter to a hex value.
Parameters: value - The value to convert The result right padded with 0 |
toHex | public static String toHex(int value)(Code) | | Converts the parameter to a hex value.
Parameters: value - The value to convert The result right padded with 0 |
toHex | public static String toHex(long value)(Code) | | Converts the parameter to a hex value.
Parameters: value - The value to convert The result right padded with 0 |
|
|