better binary data display

This commit is contained in:
Honfika
2013-12-28 14:09:07 +01:00
parent 8ddc8c206c
commit b65e16c79c
2 changed files with 24 additions and 15 deletions
+12 -6
View File
@@ -598,13 +598,19 @@ public class Helper {
for (int i = 0; i < bytesPerRow; i++) {
int idx = row * bytesPerRow + i;
if (data.length == idx) {
break;
if (data.length > idx) {
if (i> 0 && i % groupSize == 0) {
writer.appendNoHilight(" ");
}
writer.appendNoHilight(String.format("%02x ", data[idx]));
} else {
if (addChars) {
if (i> 0 && i % groupSize == 0) {
writer.appendNoHilight(" ");
}
writer.appendNoHilight(" ");
}
}
if (i> 0 && i % groupSize == 0) {
writer.appendNoHilight(" ");
}
writer.appendNoHilight(String.format("%02x ", data[idx]));
}
if (addChars) {