예제 #1
0
파일: Main.java 프로젝트: namihira-k/java8
  public static void main(String[] args) {
    // setup
    final Path in = getPath("in.txt");
    final Path out = getPath("out.txt");

    // action
    try {
      final byte[] bytes = Files.readAllBytes(in);
      System.out.println("-->");
      System.out.println(new String(bytes));

      final byte[] reversed = CollectionUtils.reverse(bytes);
      Files.write(out, reversed);
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }

    // check
    try {
      final byte[] result = Files.readAllBytes(out);
      System.out.println("<--");
      System.out.println(new String(result));
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
  }
예제 #2
0
  static {
    transforms.put("void", "V");
    transforms.put("byte", "B");
    transforms.put("char", "C");
    transforms.put("double", "D");
    transforms.put("float", "F");
    transforms.put("int", "I");
    transforms.put("long", "J");
    transforms.put("short", "S");
    transforms.put("boolean", "Z");

    CollectionUtils.reverse(transforms, rtransforms);
  }