code: public static void printBuffer(byte[] buffer, String msg) {
          StringBuilder sb = new StringBuilder();
  
          for (int i = 0; i < buffer.length; i++) {
              if (i % 20 == 0) {
                  sb.append("\n\t");
              }
              sb.append(String.format("%02x", buffer[i]));
          }
  
          logger.info("{}: {}", msg, sb.toString());
      }
docs: Print a formatted version of @buffer in hex
  @param buffer the byte buffer to display