summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing0413.java
blob: 850af531ed29e7115a2f1202f8e7eb3696a3d83c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Listing0413 */

public class Listing0413
{
  public static void main(String[] args)
  {
    for (int i = 0; i < 256; ++i) {
      System.out.print("i=" + i);
      byte b = ByteKit.fromUnsignedInt(i);
      System.out.print(" b=" + ByteKit.toBitString(b));
      char c = ByteKit.toChar(b);
      System.out.print(" c=" + (c >= 32 ? c : '.'));
      System.out.println();
    }
  }
}