Check out example codes for "c# read all lines from filestream". It will help you in understanding the concepts better.

Code Example 1

public IEnumerable<string> ReadLines(Func<Stream> streamProvider,
                                     Encoding encoding)
{
    using (var stream = streamProvider())
    using (var reader = new StreamReader(stream, encoding))
    {
        string line;
        while ((line = reader.ReadLine()) != null)
        {
            yield return line;
        }
    }
}

Learn ReactJs, React Native from akashmittal.com