HexPrinter.java

  1. package lv.id.jc.correcter.printer;

  2. import java.util.StringJoiner;

  3. public class HexPrinter implements Printer {

  4.     @Override
  5.     public String apply(byte[] data) {
  6.         var view = new StringJoiner(" ");
  7.         for (var element : data) {
  8.             view.add(String.format("%X", element));
  9.         }
  10.         return "hex view: " + view;
  11.     }
  12. }