XenAPI.HTTP.ReadLine C# (CSharp) Method

ReadLine() private static method

private static ReadLine ( Stream stream ) : string
stream Stream
return string
        private static string ReadLine(Stream stream)
        {
            System.Text.StringBuilder result = new StringBuilder();
            while (true)
            {
                int b = stream.ReadByte();
                if (b == -1)
                    throw new EndOfStreamException();
                char c = Convert.ToChar(b);
                result.Append(c);
                if (c == '\n')
                    return result.ToString();
            }
        }