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); } }
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); }