Skip to content

Instantly share code, notes, and snippets.

View MYG63's full-sized avatar
💭
I may be slow to respond.

MYG63

💭
I may be slow to respond.
View GitHub Profile
@geekman
geekman / hexdump.java
Created March 26, 2013 06:31
simple hex dump in Java
public static String hexdump(byte[] data) {
final int perRow = 16;
final String hexChars = "0123456789ABCDEF";
StringBuilder dump = new StringBuilder();
StringBuilder chars = null;
for (int i = 0; i < data.length; i++) {
int offset = i % perRow;
if (offset == 0) {
chars = new StringBuilder();