tribble.util
Class HexDump

java.lang.Object
  extended by tribble.util.HexDump

public abstract class HexDump
extends java.lang.Object

Hexadecimal dump utility methods.

Since:
2000-02-08
Version:
$Revision: 1.4 $ $Date: 2003/02/18 00:33:11 $
Author:
David R. Tribble, david@tribble.com.
Copyright ©2000-2003 by David R. Tribble, all rights reserved.
Permission is granted to freely use and distribute this source code provided that the original copyright and authorship notices remain intact.
See Also:
HexDumper

Field Summary
static int VERS
          Class version number.
 
Method Summary
static void hexDump(java.io.InputStream in, java.io.PrintStream out)
          Print the contents of an input stream as a hexadecimal dump to an output stream.
static void hexDump(java.io.InputStream in, java.io.PrintWriter out)
          Print the contents of an input stream as a hexadecimal dump to an output stream.
static void hexDump(java.io.PrintStream out, byte[] data)
          Print the contents of a byte array as a hexadecimal dump to an output stream.
static void hexDump(java.io.PrintStream out, byte[] data, int off, int len)
          Print the contents of a byte array as a hexadecimal dump to an output stream.
static void hexDump(java.io.PrintStream out, java.lang.String s)
          Print the contents of a string as a hexadecimal dump to an output stream.
static void hexDump(java.io.PrintStream out, java.lang.String s, int off, int len)
          Print the contents of a string as a hexadecimal dump to an output stream.
static void hexDump(java.io.PrintWriter out, byte[] data)
          Print the contents of a byte array as a hexadecimal dump to an output stream.
static void hexDump(java.io.PrintWriter out, byte[] data, int off, int len)
          Print the contents of a byte array as a hexadecimal dump to an output stream.
static void hexDump(java.io.PrintWriter out, java.lang.String s)
          Print the contents of a string as a hexadecimal dump to an output stream.
static void hexDump(java.io.PrintWriter out, java.lang.String s, int off, int len)
          Print the contents of a string as a hexadecimal dump to an output stream.
static void hexDumpAt(java.io.PrintWriter out, byte[] data, int off, int len, int base)
          Print the contents of a byte array as a hexadecimal dump to an output stream.
static void hexDumpStringAt(java.io.PrintWriter out, java.lang.String data, int off, int len, int base)
          Print the contents of a string as a hexadecimal dump to an output stream.
static void main(java.lang.String[] args)
          Print the contents of one or more files as a hexadecimal dump to the standard output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERS

public static final int VERS
Class version number.

See Also:
Constant Field Values
Method Detail

hexDump

public static void hexDump(java.io.PrintWriter out,
                           byte[] data)
Print the contents of a byte array as a hexadecimal dump to an output stream.

This method is equivalent to:

    hexDump(out, data, 0, data.length); 

Parameters:
out - An output stream.
data - An array of bytes to dump to out.
Since:
1.3, 2003-02-15

hexDump

public static void hexDump(java.io.PrintWriter out,
                           byte[] data,
                           int off,
                           int len)
Print the contents of a byte array as a hexadecimal dump to an output stream.

Parameters:
out - An output stream.
data - An array of bytes to dump to out.
off - The index of the first byte within the byte array to dump.
len - The number of bytes within the byte array to dump.
Since:
1.3, 2003-02-15

hexDump

public static void hexDump(java.io.PrintStream out,
                           byte[] data)
Print the contents of a byte array as a hexadecimal dump to an output stream.

This method is equivalent to:

    hexDump(out, data, 0, data.length); 

Parameters:
out - An output stream.
data - An array of bytes to dump to out.
Since:
1.3, 2003-02-15

hexDump

public static void hexDump(java.io.PrintStream out,
                           byte[] data,
                           int off,
                           int len)
Print the contents of a byte array as a hexadecimal dump to an output stream.

Parameters:
out - An output stream.
data - An array of bytes to dump to out.
off - The index of the first byte within the byte array to dump.
len - The number of bytes within the byte array to dump.
Since:
1.3, 2003-02-15

hexDump

public static void hexDump(java.io.PrintWriter out,
                           java.lang.String s)
Print the contents of a string as a hexadecimal dump to an output stream.

This method is equivalent to:

    hexDump(out, s, 0, s.length()); 

Parameters:
out - An output stream.
s - A string of Unicode characters to dump to out.
Since:
1.3, 2003-02-15

hexDump

public static void hexDump(java.io.PrintWriter out,
                           java.lang.String s,
                           int off,
                           int len)
Print the contents of a string as a hexadecimal dump to an output stream.

Parameters:
out - An output stream.
off - The index of the first character within the string to dump.
len - The number of bytes within the byte array to dump.
s - A string of Unicode characters to dump to out.
Since:
1.3, 2003-02-15

hexDump

public static void hexDump(java.io.PrintStream out,
                           java.lang.String s)
Print the contents of a string as a hexadecimal dump to an output stream.

This method is equivalent to:

    hexDump(out, s, 0, s.length()); 

Parameters:
out - An output stream.
s - A string of Unicode characters to dump to out.
Since:
1.3, 2003-02-15

hexDump

public static void hexDump(java.io.PrintStream out,
                           java.lang.String s,
                           int off,
                           int len)
Print the contents of a string as a hexadecimal dump to an output stream.

Parameters:
out - An output stream.
off - The index of the first character within the string to dump.
len - The number of bytes within the byte array to dump.
s - A string of Unicode characters to dump to out.
Since:
1.3, 2003-02-15

hexDump

public static void hexDump(java.io.InputStream in,
                           java.io.PrintWriter out)
Print the contents of an input stream as a hexadecimal dump to an output stream.

Note that any IOExceptions thrown while reading from the input stream or writing to the output stream are ignored.

Parameters:
in - An input (byte) stream. Note that this stream is not closed after reading its contents.
out - An output stream.
Since:
1.3, 2003-02-15

hexDump

public static void hexDump(java.io.InputStream in,
                           java.io.PrintStream out)
Print the contents of an input stream as a hexadecimal dump to an output stream.

Note that any IOExceptions thrown while reading from the input stream or writing to the output stream are ignored.

Parameters:
in - An input (byte) stream. Note that this stream is not closed after reading its contents.
out - An output stream.
Since:
1.3, 2003-02-15

hexDumpAt

public static void hexDumpAt(java.io.PrintWriter out,
                             byte[] data,
                             int off,
                             int len,
                             int base)
Print the contents of a byte array as a hexadecimal dump to an output stream.

Parameters:
out - An output stream.
data - An array of bytes to dump to out.
off - The index of the first byte within the byte array to dump.
len - The number of bytes within the byte array to dump
base - The base address to assume in the printed dump.
Since:
1.4, 2003-02-17 (2003-02-15)

hexDumpStringAt

public static void hexDumpStringAt(java.io.PrintWriter out,
                                   java.lang.String data,
                                   int off,
                                   int len,
                                   int base)
Print the contents of a string as a hexadecimal dump to an output stream.

Parameters:
out - An output stream.
data - A string of Unicode characters to dump to out.
off - The index of the first byte within the byte array to dump.
len - The number of bytes within the byte array to dump
base - The base address to assume in the printed dump.
Since:
1.4, 2003-02-17 (2003-02-15)

main

public static void main(java.lang.String[] args)
Print the contents of one or more files as a hexadecimal dump to the standard output stream.

Usage

    java tribble.util.HexDump file... 

Parameters:
args - Command line arguments (filenames to dump).
Since:
1.1, 2000-02-08