title: ObjectOutputStream not writing to file
body: <p>I'm trying to serialize an object to file with the following:</p>
  
  <pre><code>// fill with some test data 
  ArrayList&lt;Transaction&gt; transactions = new ArrayList&lt;&gt;();
  transactions.add(new Transaction("Internet", "2016-09-20", -28));
  transactions.add(new Transaction("Groceries", "2016-09-20", -26));
  
  //serialize transactions 
  try {
  //          File f = new File("transactions.ser");
  //          OutputStream file = new FileOutputStream(f);
  //          OutputStream buffer = new BufferedOutputStream(file);
  //          ObjectOutput output = new ObjectOutputStream(buffer);
  
      File f = new File("transactions.ser");
      FileOutputStream fos = new FileOutputStream(f);
      ObjectOutputStream out = new ObjectOutputStream(fos);
      out.writeObject(transactions);
      out.flush();
      out.close();
  
      FileInputStream fis = new FileInputStream(f);
      ObjectInputStream in = new ObjectInputStream(fis);
      Object o = in.readObject();
      System.out.println(o);
  
  } 
  catch(IOException e){
      System.out.println("IOException");
  } 
  catch(ClassNotFoundException e) {
      System.out.println("ClassNotFoundException");
  }
  </code></pre>
  
  <p>..however the IOException is being thrown. The code that is commented out does manage to create the file, but it was empty, so I assume that it's not a permissions issue? After some reading I found ObjectOutputStream but won't write to the file. What am I doing wrong?</p>