import java.io.FileOutputStream;
import java.io.IOException;


public class FileOutput {

  /**
   * @param args
   * @throws IOException 
   */
  public static void main(String[] args) throws IOException {
      FileOutputStream f = new FileOutputStream("test.txt");
      f.write("Hello world!\n".getBytes());
      f.close();
      
      FileOutputStream f2 = new FileOutputStream("test.txt", true);
      f2.write("Hello world again!".getBytes());
      f2.close();
      

  }

}

@@ -26,16 +26,69 @@
 Stream;%0A
+import java.io.FileInputStream;%0Aimport java.io.File;%0A
 import j
@@ -108,17 +108,16 @@
 ption;%0A%0A
-%0A
 public c
@@ -252,16 +252,26 @@
 ption %7B%0A
+    try %7B%0A
       Fi
@@ -533,16 +533,463 @@
 %0A      %0A
+      FileInputStream in = new FileInputStream(%22test.txt%22);%0A      byte%5B%5D buffer = new byte%5B256%5D;%0A      int c;%0A      int offset = 0;%0A      while ((c = in.read(buffer, offset, buffer.length - offset)) != -1) %7B%0A        offset += c;%0A      %7D%0A%0A      if (! %22Hello world!%5CnHello world again!%22.equals%0A          (new String(buffer, 0, offset)))%0A      %7B%0A        throw new RuntimeException();%0A      %7D%0A    %7D finally %7B%0A      new File(%22test.txt%22).delete();%0A    %7D
 %0A  %7D%0A%0A%7D%0A

verify file contents in FileOutput test