예제 #1
0
파일: A.java 프로젝트: hiroshi-cl/wakaba
 private static void setStream(String in, String out) {
   try {
     System.setIn(new BufferedInputStream(new FileInputStream(in)));
     System.setOut(new PrintStream(out));
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
예제 #2
0
파일: A.java 프로젝트: hiroshi-cl/wakaba
    public void diff(int id, String small, String large) {
      try {
        Scanner sm = new Scanner(new File(small));
        Scanner lg = new Scanner(new File(large));
        int line = 0;
        while (sm.hasNextLine() && lg.hasNextLine()) {
          String s = sm.nextLine();
          String l = lg.nextLine();
          if (!s.equals(l)) {
            System.out.println(line + ">" + s);
            System.out.println(line + "<" + l);
          }
          line++;
        }

      } catch (Exception e) {
        e.printStackTrace();
      }
    }