fr.dyade.aaa.common
Class BinaryDump

java.lang.Object
  extended by fr.dyade.aaa.common.BinaryDump

public class BinaryDump
extends java.lang.Object


Field Summary
static java.lang.String EOL
           
 
Constructor Summary
BinaryDump()
           
 
Method Summary
static java.lang.String dump(byte[] data, long offset, int index)
          dump an array of bytes to a String
static java.lang.String toHex(byte value)
          Converts the parameter to a hex value.
static java.lang.String toHex(byte[] value)
          Dumps the byte array in hexadecimal format.
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(byte[] value, int offset, int length)
          dump an array of bytes to a String
 
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
Constructor Detail

BinaryDump

public BinaryDump()
Method Detail

dump

public static java.lang.String dump(byte[] data,
                                    long offset,
                                    int index)
dump an array of bytes to a String

Parameters:
data - the byte array to be dumped
offset - its offset, whatever that might mean
index - initial index into the byte array
Returns:
output string
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is outside the data array's bounds

toHex

public static java.lang.String toHex(byte[] value)
Dumps the byte array in hexadecimal format.

Parameters:
value - The value to convert
Returns:
A String representing the array of bytes

toHex

public static java.lang.String toHex(byte[] value,
                                     int offset,
                                     int length)
dump an array of bytes to a String

Parameters:
data - the byte array to be dumped
offset - its offset, whatever that might mean
index - initial index into the byte array
Returns:
output string
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is outside the data array's bounds

toHex

public static java.lang.String toHex(byte[] value,
                                     int bytesPerLine)
Converts the parameter to a hex value breaking the results into lines.

Parameters:
value - The value to convert
bytesPerLine - The maximum number of bytes per line. The next byte will be written to a new line
Returns:
A String representing the array of bytes

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


Copyright © 2011 ScalAgent D.T.. All Rights Reserved.