Created
December 19, 2019 16:16
-
-
Save typelogic/65d4708db7f91d55429d7c9b9d27d17c to your computer and use it in GitHub Desktop.
java hexdump
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void prettyOut(byte[] msg) { | |
| for (int j = 1; j < msg.length+1; j++) { | |
| if (j % 32 == 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 % 8 == 0) { | |
| System.out.print(" "); | |
| } | |
| } | |
| System.out.println(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment