title: Read from NetworkStream to delimiter
body: <p>what is the best way to read from NetworkStream to some delimiter (for example "\n")</p>
  
  <p>I have following code:</p>
  
  <pre><code>        NetworkStream clientStream = tcpClient.GetStream();
          var message = new byte[4096];
  
          while (true)
          {
              int bytesRead = 0;
  
              try
              {
                  bytesRead = clientStream.Read(message, 0, 4096);
              }
              catch
              {
                  // Exception
              }
              Response(message);
          }
  </code></pre>
  
  <p>Problem is, that from client sends something like "Some text\n continues on newline" but I would like to answer first on "Some text", then accept next line and send response.</p>