|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.communications.util.DumpBytes
public class DumpBytes
Dumps hexadecimal, decimal, octal and binary representations of any given File, String or byte array. For example, the different representations for the string "helloworld" will show:
Hexadecimal:
68 65 6c 6c 6f 77 6f 72 6c 64 helloworld
Decimal:
104 101 108 108 111 119 111 114 hellowor 108 100 ld
Octal:
150 145 154 154 157 167 hellow 157 162 154 144 orld
Binary:
1101000 1100101 1101100 1101100 1101111 hello 1110111 1101111 1110010 1101100 1100100 world
| Field Summary | |
|---|---|
static int |
BASE_BIN
Binary base (2). |
static int |
BASE_DEC
Decimal base (10). |
static int |
BASE_HEX
Hexadecimal base (16). |
static int |
BASE_OCT
Octal base (8). |
| Constructor Summary | |
|---|---|
DumpBytes()
|
|
| Method Summary | |
|---|---|
static String |
dumpBinData(byte[] data)
Converts the given byte array to binary format. |
static String |
dumpBinData(File f)
Converts the contents of the given File to binary format. |
static String |
dumpBinData(String data)
Converts the given String to binary format. |
static String |
dumpData(byte[] bytes,
int cols,
int format)
Converts the given byte array to a numerical format representation. |
static String |
dumpData(File file,
int cols,
int format)
Reads the given File and converts its contents to a numerical format representation. |
static String |
dumpData(String data,
int cols,
int format)
Converts the given String to a numerical format representation. |
static String |
dumpDecData(byte[] data)
Converts the given byte array to decimal format. |
static String |
dumpDecData(File f)
Converts the contents of the given File to decimal format. |
static String |
dumpDecData(String data)
Converts the given String to decimal format. |
static String |
dumpHexData(byte[] data)
Converts the given byte array to hexadecimal format. |
static String |
dumpHexData(File f)
Converts the contents of the given File to hexadecimal format. |
static String |
dumpHexData(String data)
Converts the given String to hexadecimal format. |
static String |
dumpOctData(byte[] data)
Converts the given byte array to octal format. |
static String |
dumpOctData(File f)
Converts the contents of the given File to octal format. |
static String |
dumpOctData(String data)
Converts the given String to octal format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BASE_HEX
public static final int BASE_DEC
public static final int BASE_OCT
public static final int BASE_BIN
| Constructor Detail |
|---|
public DumpBytes()
| Method Detail |
|---|
public static String dumpData(byte[] bytes,
int cols,
int format)
bytes - data to be converted to a particular numerical formatcols - number of columns the output data will haveformat - numerical base the output will be shown as - e.g. BASE_HEX is hex
IllegalArgumentException - if format is invalid
public static String dumpData(String data,
int cols,
int format)
data - String to be converted to a particular numerical formatcols - number of columns the output data will haveformat - numerical base the output will be shown as (e.g. 16 is hex)
public static String dumpData(File file,
int cols,
int format)
file - File whose contents are to be converted to a particular numerical formatcols - number of columns the output data will haveformat - numerical base the output will be shown as (e.g. 16 is hex)
public static String dumpBinData(File f)
f - file whose contents is to be converted
public static String dumpBinData(byte[] data)
data - byte array to be converted
public static String dumpBinData(String data)
data - String to be converted
public static String dumpOctData(File f)
f - file whose contents is to be converted
public static String dumpOctData(byte[] data)
data - byte array to be converted
public static String dumpOctData(String data)
data - String to be converted
public static String dumpDecData(File f)
f - file whose contents is to be converted
public static String dumpDecData(byte[] data)
data - byte array to be converted
public static String dumpDecData(String data)
data - String to be converted
public static String dumpHexData(File f)
f - file whose contents is to be converted
public static String dumpHexData(byte[] data)
data - byte array to be converted
public static String dumpHexData(String data)
data - String to be converted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||