Beispiel #1
0
        public void MeteorJsonStreamPerformanceTest()
        {
            var cs = "";

            for (int i = 0; i < LoopCount; i++)
            {
                foreach (var elements in TweetSamples.GetStreamSampleElements())
                {
                    var memstream = new MemoryStream(Encoding.UTF8.GetBytes(elements));
                    var reader    = new JsonStreamParser(memstream);
                    var parsed    = reader.Parse();
                    if (parsed.ContainsKey("text") && parsed.ContainsKey("user") && parsed["user"].ContainsKey("screen_name"))
                    {
                        cs = "@" + parsed["user"]["screen_name"].AsString() + ": " + parsed["text"].AsString();
                    }
                }
            }
            // Trace.WriteLine(cs);
        }
 /// <summary>
 /// Parse the <see cref="Stream" /> into a dictionary.
 /// </summary>
 /// <param name="stream">The stream to parse.</param>
 /// <returns>A dictionary representing the configuration in a flattened form.</returns>
 public IDictionary <string, string> Parse(Stream stream)
 {
     return(JsonStreamParser.Parse(stream));
 }