title: Can't use InputStream from Socket after writeObject
body: <p>Here is the situation:
  I have a ServerSocket ss, and "Socket socket = ss.accept();", then if I do this:</p>
  
  <pre><code>istream = socket.getInputStream();
  ostream = socket.getOutputStream();   
  in = new BufferedReader(new InputStreamReader(istream));
  out = new PrintWriter(new BufferedOutputStream(ostream));
  /*
    I use in/out few times
    everything OK
  
  */
  ObjectOutputStream oos = new ObjectOutputStream(ostream);
  oos.writeObject(someobject);
  /* probably code that solves the problem */
  String line = in.readLine();
  </code></pre>
  
  <p>On the client side I have this code:</p>
  
  <pre><code>PrintWriter out = new PrintWriter(new BufferedOutputStream(socket.getOutputStream()),true);
  BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
  /*
      using in/out, no problems
  */
  ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
  SomeObject so = (SomeObject)ois.readObject();
  out.println("some text");
  </code></pre>
  
  <p>Everything is OK, until I send someobject. Client recieves object properly, no problems there. But I can't use socket anymore. If I do oos.close(), I get Exception that says "socket closed". If I do oos.reset() I get Exception with similar message. "socket reset". So what should I do? Is it possible to use same input and output streams after writeObject()?</p>
  
  <p>What happens when I send "some text" is that I'm just getting nulls no matter how many times I call readLine(), I never get that "some text".</p>