|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.claritysys.util.Hexadecimal
public final class Hexadecimal
Provides methods for dumping binary data to a console display.
The class is composed of static methods, and, unfortunately, a static buffer. Thus it is not thread-safe.
Constructor Summary | |
---|---|
Hexadecimal()
|
Method Summary | |
---|---|
static void |
printHexByte(byte b)
Print a single byte as a hex pair to System-out. |
static void |
printHexLine(byte[] buf,
int address,
int count)
Dump one line of memory as hex dump. |
static void |
printHexRange(byte[] buf,
int addressBegin,
int addressEnd)
Dump a range of memory in hex dump format. |
static void |
printHexWord(int word)
Print a single word as a hex quad to System-out. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Hexadecimal()
Method Detail |
---|
public static void printHexRange(byte[] buf, int addressBegin, int addressEnd)
Note that addressBegin will appear flush left, instead of being properly aligned to a 16-byte boundary. It would be a good enhancement, I think, to start printing at the correct column position. For example, dumping from address 0x0003 will currently print:
0003: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........whereas it should print:
0003: 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
buf
- The byte array to interpret data from.addressBegin
- The starting address in buf to dump data from.addressEnd
- The ending address.public static void printHexLine(byte[] buf, int address, int count)
This will dump the 16 bytes or less given in the following format:
aaaa: hh hh hh hh hh hh hh hh hh hh hh hh hh hh hh hh ........ ........
public static void printHexByte(byte b)
b
- The byte to print.public static void printHexWord(int word)
word
- The 2-byte value to print.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |