/****************************************************************************** * This program converts input stream of bytes to hexadecimal. * * Copyright © 2020 Richard Lesh. All rights reserved. *****************************************************************************/ import org.pureprogrammer.Utils; public class HexadecimalFilter { public static void main(String[] args) { int c; String hex; int count = 0; while ((c = Utils.getbyte(System.in)) != -1) { ++count; hex = Utils.format("{0:02x}", c); System.out.print(hex); if (count % 32 == 0) { System.out.println(); } } } }