java.lang.Object | |
↳ | com.ericsson.research.trap.utils.HexDump |
Utility class to print out hexadecimal and pretty data, primarily for debug purposes. When printed, the data is shown in a reasonable and understandable format, like the one below.
54 68 69 73 20 69 73 20 61 6e 20 65 78 61 6d 70 6c 65 20 6f This.is.an.example.o 66 20 68 65 78 20 64 75 6d 70 69 6e 67 20 73 6f 6d 65 20 62 f.hex.dumping.some.b 79 74 65 73 2e 2e 2e ytes...
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new object with a toString method that will lazily perform a HexDump on the supplied data.
| |||||||||||
Prints the supplied bytes as ASCII to System.out.
| |||||||||||
Prints a set of bytes to a given stream.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Creates a new object with a toString method that will lazily perform a HexDump on the supplied data. This can be used when it is not known if the resulting string will be printed, to save on some computation.
bytes | The bytes to HexDump |
---|---|
start | Offset in the bytes to start at. |
width | Width (in bytes) of the hex dump |
Prints the supplied bytes as ASCII to System.out.
bytes | The bytes to print |
---|---|
start | Index to start printing from |
width | Width in bytes |
Prints a set of bytes to a given stream. The output format is the one specified in the class description. Prints the bytes as hex and ascii until the end of the byte array.
bytes | The source bytes to print. |
---|---|
start | The offset to start printing from. |
width | Width in bytes of the printed output |
ps | The stream to print to. |