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
private static char[] _hexcodes
           
private static int[] _shifts
           
static java.lang.String EOL
           
 
Constructor Summary
BinaryDump()
           
 
Method Summary
private static java.lang.String dump(byte value)
           
static java.lang.String dump(byte[] data, long offset, int index)
          dump an array of bytes to a String
private static java.lang.String dump(long value)
           
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
private static java.lang.String toHex(long value, int digits)
           
 
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

_hexcodes

private static final char[] _hexcodes

_shifts

private static final int[] _shifts
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

dump

private static java.lang.String dump(long value)

dump

private static java.lang.String dump(byte value)

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

toHex

private static java.lang.String toHex(long value,
                                      int digits)


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