List of utility methods to do Array Dump
String | dumpHexString(final byte[] array) dump Hex String return dumpHexString(array, 0, array.length);
|
void | dumpInt(String name, int[] src) dump Int System.out.println(String.format("%s: [", name)); int col = 0; for (int i = 0; i < src.length; ++i) { if (col == 0) { System.out.format(" "); System.out.format(" %08x", src[i]); col = (col + 1) % 8; ... |
String | dumpIntArray(int[] A, int n) dump Int Array String str = ""; for (int i = 0; i < n; i++) str += " " + A[i]; return str; |
void | dumpIntArray(int[] data, String label) dump Int Array System.out.print(label); for (int i = 0; i < data.length; ++i) { if (i % 6 == 0) { System.out.println(); System.out.format(" %1$11d", data[i]); System.out.println(); ... |
void | dumpMatrix(byte[] matrix, int numDataUnits, int numAllUnits) dump Matrix for (int i = 0; i < numDataUnits; i++) { for (int j = 0; j < numAllUnits; j++) { System.out.print(" "); System.out.print(0xff & matrix[i * numAllUnits + j]); System.out.println(); |
String | dumpMessage(byte b[]) dump Message return dumpMessage(b, 0, b.length);
|
void | dumpOctets(byte[] data) dump Octets final int inc = 8; for (int i = 0; i < data.length; i += inc) { for (int j = i; j - i < inc; j++) { if (j < data.length) { int n = data[j]; if (n < 0) { n += 256; String s; if (n < 10) { s = " " + n; } else if (n < 100) { s = " " + n; } else { s = "" + n; System.out.print(s + " "); } else { System.out.print(" "); System.out.print('"'); for (int j = i; j < data.length && j - i < inc; j++) { if (data[j] >= (byte) 32 && data[j] < (byte) 127) { System.out.print((char) data[j]); } else { System.out.print('.'); System.out.println('"'); |
void | dumpPosition(long[] position) dump Position for (long p : position) { System.out.print(" " + p); System.out.println(); |
String | dumpStackTrace(StackTraceElement[] elements) dump Stack Trace String dump = ""; for (StackTraceElement element : elements) { dump += element.toString() + "\n"; return dump; |
String | dumpString(byte[] b) converts a byte array to printable characters StringBuffer d = new StringBuffer(b.length * 2); for (int i = 0; i < b.length; i++) { char c = (char) b[i]; if (Character.isISOControl(c)) { switch (c) { case '\r': d.append("{CR}"); break; ... |