public CommentIgnoringJsonTextReader(TextReader reader)
     : this(ParsingTextReader.Create(reader))
 {
 }
Пример #2
0
        /// <summary>
        /// Loads a Result Set from an Input using a Results Handler.
        /// </summary>
        /// <param name="handler">Results Handler to use.</param>
        /// <param name="input">Input to read from.</param>
        public void Load(ISparqlResultsHandler handler, TextReader input)
        {
            if (handler == null)
            {
                throw new RdfParseException("Cannot parse SPARQL Results into a null Result Handler");
            }
            if (input == null)
            {
                throw new RdfParseException("Cannot parse SPARQL Results from a null input stream");
            }

            try
            {
                TokenisingResultParserContext context = new TokenisingResultParserContext(handler, new CsvTokeniser(ParsingTextReader.Create(input)));
                TryParseResults(context);
                input.Close();
            }
            catch
            {
                try
                {
                    input.Close();
                }
                catch
                {
                    // No catch actions just trying to clean up
                }
                throw;
            }
        }