Skip to content

Instantly share code, notes, and snippets.

@I3rixon
I3rixon / Main.java
Created July 29, 2013 00:46
pretty output of hexdump like in Java
public static void prettyOut(byte[] msg) {
for (int j = 1; j < msg.length+1; j++) {
if (j % 8 == 1 || j == 0) {
if( j != 0){
System.out.println();
}
System.out.format("0%d\t|\t", j / 8);
}
System.out.format("%02X", msg[j-1]);
if (j % 4 == 0) {