title: NetworkStream missing data
body: <p>The data in question is a PNG file prefixed by it's size as an int.<p></p>
  
  <pre><code>-Sending:
  ns.Write(BitConverter.GetBytes((int)data.Length),0,4);
  ns.Write(data, 0, data.Length);
  
  -Reading:
  byte[] sizearray = new byte[4];
  ns.Read(sizearray, 0, 4);
  int dataSize = BitConverter.ToInt32(sizearray,0);
  
  byte[] data = new byte[dataSize];
  ns.Read(data, 0, dataSize);
  </code></pre>
  
  <p>The recieved data is then saved to a file. I've also tried this with BeginRead/EndRead with the same result.<p>
  The issue is, while this works for most smaller images, it doesn't receive an image which is more then a few KB. The dataSize reads correctly, but after a few thousand bytes each time (~2900), the rest of the received data is 0. <a href="http://i.stack.imgur.com/8NBWg.png" rel="nofollow">Example</a> <p>
  <p>Have I overlooked something, like a limit on how much can be sent at once?</p>