Exemplo n.º 1
0
        internal static bool ContainsJson(this System.IO.StreamReader reader)
        {
            var startPosition = reader.GetPosition();

            for (char c = (char)reader.Read(); c != '{'; c = (char)reader.Read())
            {
                if (c != '\r' && c != '\n' && !char.IsWhiteSpace(c))
                {
                    reader.SetPosition(startPosition);
                    return(false);
                }
            }

            reader.SetPosition(startPosition);
            return(true);
        }