org.apache.commons.io
Class HexDump

java.lang.Object
  extended by org.apache.commons.io.HexDump

public class HexDump
extends java.lang.Object

Dumps data in hexadecimal format.

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 $
Author:
Scott Sanders, Marc Johnson

Field Summary
static java.lang.String EOL
          The line-separator (initializes to "line.separator" system property.
 
Constructor Summary
HexDump()
          Instances should NOT be constructed in standard programming.
 
Method Summary
static void dump(byte[] data, long offset, java.io.OutputStream stream, int index)
          Dump an array of bytes to an OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOL

public static final java.lang.String EOL
The line-separator (initializes to "line.separator" system property.

Constructor Detail

HexDump

public HexDump()
Instances should NOT be constructed in standard programming.

Method Detail

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 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:
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 null


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.