PPT Slide
public static void main(String[] args) {
InputStream in = System.in;
OutputStream out = System.out;
if (args.length != 2) error("must provide from/to arguments");
String from = args[0], to = args[1]; int ch, i;
if (from.length() != to.length())
error("from and to must be the same length");
while ((ch = in.read()) != -1) {
if ((i = from.indexOf(ch)) != -1)
error("I/O Exception: " + e); } }
public static void error(String err) {
System.err.print("Translate: " + err);
System.exit(1); // Error return } } }