List of utility methods to do Byte Array Print
void | printbyte(byte[] b) Prints a byte array to the console System.out.print("["); for (int i = 0; i < b.length - 1; i++) { System.out.print(b[i] + ":"); System.out.println(b[b.length - 1] + "]"); |
void | printByte(byte[] bytes) print Byte for (int i = 0; i < bytes.length; i++) { if (i > 0) { System.out.print(","); System.out.print(bytes[i]); System.out.println(); |
String | printByteArray(byte b[]) print Byte Array String str = ""; for (int i = 0; i < b.length; i++) { char c = (char) b[i]; str = (new StringBuilder(String.valueOf(str))).append(c).toString(); return str; |
String | printByteArray(byte[] bytes) print Byte Array StringBuilder sb = new StringBuilder(1024); for (byte b : bytes) { sb.append(printByte(b)).append(" "); return sb.toString(); |
String | printByteArray(byte[] bytes) print Byte Array StringBuilder stringBuilder = new StringBuilder(bytes.length); stringBuilder.append("length=").append(bytes.length).append("["); for (int i = 0; i < bytes.length; i++) { stringBuilder.append(bytes[i]); stringBuilder.append("]"); return stringBuilder.toString(); |
void | printByteArray(byte[] bytes) print Byte Array System.out.println("----------------------------------"); System.out.println("byte[] length is " + bytes.length * 8); for (int i = 0; i < bytes.length; i++) { if (((i - 1) % 8) == 0) { System.out.print(" "); for (int j = 0; j < 8; j++) { if ((bytes[i] & (1 << j)) == 1) { ... |
String | printByteArray(byte[] bytes) print Byte Array return printByteArray(bytes, true, true);
|
void | printByteArray(byte[] bytes) print Byte Array int width = 30; int counter = 0; for (byte b : bytes) { System.out.format("%02X ", b); counter++; if (counter > width) { counter = 0; System.out.println(); ... |
void | printByteArray(byte[] input) print Byte Array for (int i = 0; i < input.length; i++) { System.out.format("%02X ", input[i]); System.out.println(); |
void | printByteArrayAsChars(byte[] bytes) print Byte Array As Chars System.out.print("{"); for (int i = 0; i < bytes.length; i++) { if (i == bytes.length - 1) System.out.print((char) bytes[i] + ""); else System.out.print((char) bytes[i] + ", "); System.out.println("}"); ... |