* @param appendable
* the appendable on which the matrix is printed
*/
public static void printMatrix(ByteMatrix matrix, Appendable appendable) {
final PrintableAppendable output = PrintableAppendable.of(appendable, true);
final int R = matrix.rows();
final int C = matrix.columns();
// this prints a line with column indexes and a line for each row preceded by a row index
// (this only works fine for indices less than 100)
output.printf(" ");
for (int j = 0; j < C; j++)
output.printf("* %02d ", j);
output.println('|');
for (int i = 0; i < R; i++) {
output.printf("%02d)", i);
for (int j = 0; j < C; j++)
output.printf("| %02X ", matrix.get(i, j));
output.println('|');
}
}