The problem is not with clientStream, but rather with memoryStream. You are always writing to offset 0 in the memory stream without cleaning it out. Try adding:
memoryStream.Seek(0,SeekOrigin.Begin);
memoryStream.SetLength(0);
prior to writing to the memory stream.
However, one might ask why you're writing to the memory stream and then immediately writing that data to your network stream. Why not write directly to the network stream? Or why not write all of your data to the memory stream in a loop, then write the memory stream to the network stream after the loop?