FileDocCategorySizeDatePackage
Vis.javaAPI DocExample1139Sat Nov 25 12:54:20 GMT 2000None

Vis

public class Vis extends Object
Vis - make special characters visible.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] av)

        Vis v = new Vis();
        if (av.length == 0)
            v.process(new BufferedReader(
				new InputStreamReader(System.in)));
		else for (int i=0; i<av.length; i++)
			try {
				v.process(new BufferedReader(new FileReader(av[i])));
			} catch (FileNotFoundException e) {
				System.err.println(e);
			}
    
public voidprocess(java.io.BufferedReader is)
print one file, given an open BufferedReader

        try {
            String inputLine;

            while ((inputLine = is.readLine()) != null) {
                for (int i=0; i<inputLine.length(); i++){
					char c = inputLine.charAt(i);
					switch(c) {
						case '\t": System.out.print("\\t"); break;
						case '\r": System.out.print("\\r"); break;
						case '\n": System.out.print("\\n"); break;
						default: System.out.print(c); break;
					}
				}
				System.out.println();
            }
            is.close();
        } catch (IOException e) {
            System.out.println("IOException: " + e);
        }