title: String not received completely on client side
body: <p>In the below code i am receiving data from the server but the String is not received completely "i should receive a sentence but each time i am receiving a segment of the sentence of different lengths"</p>
  
  <pre><code>uint8_t buf[1024];
  unsigned int len = 0;
  len = [inputStream read:buf maxLength:1024];
  NSString *s;
  
     if(len &gt; 0) {
      NSMutableData* data=[[NSMutableData alloc] initWithLength:0];
      [data appendBytes: (const void *)buf length:len];
      s = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
      NSLog(@"%@",s);
  }
  </code></pre>
  
  <p>server side:
  i am sending to the server using DataOutputStream</p>
  
  <pre><code> ServerSocket welcomeSocket=new ServerSocket(6789);
   while(true){
   Socket connectionSocket=welcomeSocket.accept();
   DataOutputStream outToClient=new DataOutputStream(connectionSocket.getOutputStream());
   outToClient.writeBytes("sign up accepted you can now sign in"+'\n');
  </code></pre>
  
  <p>Also what if i need to send a long text.</p>