Is there a way to create and flush I/O streams in try-with-resources?
===

Is it possible to use the new `try-with-resources` statement in Java 7 to create both the `ObjectOutputStream` and `ObjectInputStream` at the same time, and also flush the output stream *before* the input stream is created? Right now, I'm using the old style:

    ObjectOutputStream ostream = null;
    ObjectInputStream istream = null;
    try {
      ostream = new ObjectOutputStream(this.socket.getOutputStream());
      ostream.flush();
      istream = new ObjectInputStream(this.socket.getInputStream());
      // ...
    }
    catch(Exception e) {
      e.printStackTrace();
    }
    finally {
      // Close the streams.
    }

I'd like to know if there's a better way to create and flush the streams using the new style in Java 7. Thanks!