Exemplo n.º 1
0
 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));
   }
 }
Exemplo n.º 2
0
 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();
     }
   }
 }