package example5_3javaiodecorator; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.OutputStream; import java.io.PrintWriter; public class IOWriterApp { /** * @param args */ public static void main(String[] args) throws FileNotFoundException { //OutputStream os = new FileOutputStream("output.txt"); OutputStream os = System.out; // the "standard output" stream os = new LineNumberDecorator( os ); //os = new EncryptedOutputStream("feelings", os); PrintWriter pw = new PrintWriter(os); pw.println("I wanna run, I want to hide"); pw.println("I wanna tear down the walls"); pw.println("That hold me inside."); pw.println("I wanna reach out"); pw.println("And touch the flame"); pw.println("Where the streets have no name."); pw.close(); } }