title: Error while writing a big string on a socket ?
body: <p>Hello all my friends, </p>
  
  <p>I am trying to send a long string through socket connection but I have them in two parts so I get an error while doing my processs. </p>
  
  <p>In client I am sending the file,</p>
  
  <pre><code>BufferedWriter bufferedOut = null;
  BufferedReader in = null;
  socket = new Socket("192.168.0.15",4444);
  bufferedOut = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
  in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
  
  bufferedOut.write(xmlInString, 0, xmlInString.length());
  
  /**
  * wait for response
  */
  
  byte[] buf = new byte[10000];
  int actualNumberOfBytesRead = socket.getInputStream().read(buf);
  String responseLine = new String(buf, 0, actualNumberOfBytesRead);
  </code></pre>
  
  <p>In the server,</p>
  
  <pre><code> BufferedReader in = null;
   PrintWriter out = null;
   in = new BufferedReader(new InputStreamReader(client.getInputStream()));
   out = new PrintWriter(client.getOutputStream(), true);
  
  //get the input
   byte[] buf = new byte[10000];
   int actualNumberOfBytesRead = client.getInputStream().read(buf);
   line = new String(buf, 0, actualNumberOfBytesRead);
   //send back
   out.println(result);
  </code></pre>
  
  <p>How I can get my string as one part ? Can you please show me where is my mistake on the code ?</p>
  
  <p>Thank you all </p>