title: BufferedReader readLine() blocks
body: <p>When receiving data using readLine(), even though I put a "\n" at the end of the message
  using the .flush when sending the message, the while loop that reads my message still blocks.
  Only when closing the socket connection, it leaves the loop.</p>
  
  <p>Here's the client code : </p>
  
  <pre><code>bos = new BufferedOutputStream(socket.
              getOutputStream());
  bis = new BufferedInputStream(socket.
              getInputStream());
  osw = new OutputStreamWriter(bos, "UTF-8");
  osw.write(REG_CMD + "\n");
  osw.flush();
  
  isr = new InputStreamReader(bis, "UTF-8");
  BufferedReader br = new BufferedReader(isr);
  
  String response = "";
  String line;
  
  while((line = br.readLine()) != null){
     response += line;
  }
  </code></pre>
  
  <p>and the server's code:</p>
  
  <pre><code>BufferedInputStream is;
  BufferedOutputStream os;
  
  is = new BufferedInputStream(connection.getInputStream());
  os = new BufferedOutputStream(connection.getOutputStream());
  
  isr = new InputStreamReader(is);
  
  String query= "";
  String line;
  
  while((line = br.readLine()) != null){
     query+= line;
  }
  
  String response = executeMyQuery(query);
  osw = new OutputStreamWriter(os, "UTF-8");
  
  osw.write(returnCode + "\n");
  osw.flush();
  </code></pre>
  
  <p>My code blocks at the server while loop.
  Thanks.</p>