public void handprintStdin(Polynomial p) throws IOException { HandPrintFactory factory = Handprints.newFactory(p); Handprint hand = factory.newHandprint(System.in); for (Long finger : hand.getHandFingers().keySet()) { System.out.println(String.format("%X", finger)); } }
public void handprintFiles(List<String> paths, Polynomial p) throws IOException { HandPrintFactory factory = Handprints.newFactory(p); for (String path : paths) { File file = new File(path); if (file.exists()) { Handprint hand = factory.newHandprint(new FileInputStream(file)); for (Long finger : hand.getHandFingers().keySet()) { System.out.println(String.format("%X", finger)); } System.out.flush(); } else { System.err.print(String.format("Could not find file %s", path)); System.err.flush(); } } }