title: Reading from NetworkStream. Which is better ReadLine() vs. Read into ByteArray?
body: <p>I am using TcpClient to communicate with a server that sends information in form of "\n" delimited strings. The data flow is pretty high and once the channel is set, the stream would always have information to read from. The messages can be of variable sizes.</p>
  
  <p>My question now is, would it be better to use ReadLine() method to read the messages from the stream as they are already "\n" delimited, or will it be advisable to read byteArray of some fixed size and pick up message strings from them using Split("\n") or such? (Yes, I do understand that there may be cases when the byte array gets only a part of the message, and we would have to implement logic for that too.)</p>
  
  <p>Points that need to be considered here are: </p>
  
  <ul>
  <li><p>Performance.</p></li>
  <li><p>Data Loss. Will some data be lost if the client isn't reading as fast as the data is coming in? </p></li>
  <li>Multi-Threaded setup. What if this setup has to be implemented in a multi-threaded environment, where each thread would have a separate communication channel, however would share the same resources on the client.</li>
  </ul>