title: ObjectOutputStream and PrintWriter Conflict
body: <p>I have server and client set up, which is basically a basic text email system. I am currently using a PrintWriter to send the text between the server and client. I am trying to create a attachment based system and to do this I am using a ObjectOutputStream.</p>
  
  <pre><code>private static PrintWriter output;
  private static ObjectOutputStream outStream;
  
  public ClientHandler(Socket socket) throws IOException
  {
      client = socket;
      outStream = new ObjectOutputStream(client.getOutputStream());
      input = new Scanner(client.getInputStream());
      output = new PrintWriter(client.getOutputStream(), true);
  }
  </code></pre>
  
  <p>I currently have the problem where if I try send text via the output printwriter, for some reason extra characters will be added to the beginning of the text that is sent, meaning the program cannot identify key words being passed via the printwriter to the client. The problem will stop if i comment out the creation of the outStream object. </p>
  
  <p>Can anyone give me any advice to try solve this problem of conflict?</p>