ReadLine() private method

private ReadLine ( ) : string
return string
        public void TestReadLinePushback()
        {
            using (MemoryStream pis = new MemoryStream("\r".GetBytes(Encoding.UTF8)))
            {
                DataInputStream dis = new DataInputStream(pis);

#pragma warning disable 612, 618
                string line = dis.ReadLine();
#pragma warning restore 612, 618
                if (line == null)
                {
                    fail("Got null, should return empty line");
                }

                long count = pis.Length - (line.Length + 1 /*account for the newline*/);

                if (count != 0)
                {
                    fail("Test failed: available() returns "
                         + count + " when the file is empty");
                }
            }
        }
Example #2
0
        public void TestReadLinePushback()
        {
            using (MemoryStream pis = new MemoryStream("\r".GetBytes(Encoding.UTF8)))
            {
                DataInputStream dis = new DataInputStream(pis);

#pragma warning disable 612, 618
                string line = dis.ReadLine();
#pragma warning restore 612, 618
                if (line == null)
                {
                    fail("Got null, should return empty line");
                }

                long count = pis.Length - (line.Length + 1 /*account for the newline*/);

                if (count != 0)
                {
                    fail("Test failed: available() returns "
                                         + count + " when the file is empty");
                }
            }
        }