|
||||||||||
| 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 java.lang.String |
dumpBinData(byte[] data)
Converts the given byte array to binary format. |
static java.lang.String |
dumpBinData(java.io.File f)
Converts the contents of the given File to binary format. |
static java.lang.String |
dumpBinData(java.lang.String data)
Converts the given String to binary format. |
static java.lang.String |
dumpData(byte[] bytes,
int cols,
int format)
Converts the given byte array to a numerical format representation. |
static java.lang.String |
dumpData(java.io.File file,
int cols,
int format)
Reads the given File and converts its contents to a numerical format representation. |
static java.lang.String |
dumpData(java.lang.String data,
int cols,
int format)
Converts the given String to a numerical format representation. |
static java.lang.String |
dumpDecData(byte[] data)
Converts the given byte array to decimal format. |
static java.lang.String |
dumpDecData(java.io.File f)
Converts the contents of the given File to decimal format. |
static java.lang.String |
dumpDecData(java.lang.String data)
Converts the given String to decimal format. |
static java.lang.String |
dumpHexData(byte[] data)
Converts the given byte array to hexadecimal format. |
static java.lang.String |
dumpHexData(java.io.File f)
Converts the contents of the given File to hexadecimal format. |
static java.lang.String |
dumpHexData(java.lang.String data)
Converts the given String to hexadecimal format. |
static java.lang.String |
dumpOctData(byte[] data)
Converts the given byte array to octal format. |
static java.lang.String |
dumpOctData(java.io.File f)
Converts the contents of the given File to octal format. |
static java.lang.String |
dumpOctData(java.lang.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 java.lang.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
java.lang.IllegalArgumentException - if format is invalid
public static java.lang.String dumpData(java.lang.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 java.lang.String dumpData(java.io.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 java.lang.String dumpBinData(java.io.File f)
f - file whose contents is to be converted
public static java.lang.String dumpBinData(byte[] data)
data - byte array to be converted
public static java.lang.String dumpBinData(java.lang.String data)
data - String to be converted
public static java.lang.String dumpOctData(java.io.File f)
f - file whose contents is to be converted
public static java.lang.String dumpOctData(byte[] data)
data - byte array to be converted
public static java.lang.String dumpOctData(java.lang.String data)
data - String to be converted
public static java.lang.String dumpDecData(java.io.File f)
f - file whose contents is to be converted
public static java.lang.String dumpDecData(byte[] data)
data - byte array to be converted
public static java.lang.String dumpDecData(java.lang.String data)
data - String to be converted
public static java.lang.String dumpHexData(java.io.File f)
f - file whose contents is to be converted
public static java.lang.String dumpHexData(byte[] data)
data - byte array to be converted
public static java.lang.String dumpHexData(java.lang.String data)
data - String to be converted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||