title: Java Socket program can not read data if the server sends data using write and recieves data using readUTF()
body: <p>I have written a socket program where the client uses <code>readUTF()</code> and <code>writeUTF()</code> to communicate with the server while the server uses read() and write() to communicate with client.</p>
  
  <p>My server can read all the data coming from server. I am using write() on the server side and readUTF() in client side.</p>
  
  <p>So, in this scenario my client is unable to get all the data that is sent by the server if the data size is large, only some portion of data is received.</p>
  
  <p>What should be done to ensure that all data is transmitted?</p>