title: SocketTimeoutException while readFully
body: <p>I have below code which throws SocketTimeoutException.</p>
  
  <pre><code>Socket socket = new Socket(localhost, 9978);
  socket.setSoTimeout(10000);
  OutputStream oStream= socket.getOutputStream();
  byte[] data = new byte[] {'h', 'e', 'l', 'l', 'o'};
  oStream.write(data);
  oStream.flush();
  DataInputStream iStream = new DataInputStream(socket.getInputStream());
  final byte[] received = new byte[data.length];
  data.readFully(received);
  </code></pre>
  
  <p>At readFully, I get SocketTimeoutException. So, certainly i have wrong code but I am not sure what. </p>
  
  <p>Thanks for the help.</p>