OptionParser p = new OptionParser();
OptionSet opts = p.parse(args.toArray(new String[0]));
if (opts.nonOptionArguments().size() != 2) {
err.println("Expected 2 args: from_file to_file (local filenames," +
" Hadoop URI's, or '-' for stdin/stdout");
p.printHelpOn(err);
return 1;
}
BufferedInputStream inStream = Util.fileOrStdin(args.get(0), stdin);
BufferedOutputStream outStream = Util.fileOrStdout(args.get(1), out);