Example #1
0
        private static ServerInformationComplete[] DeserializeFast(Stream stream)
        {
            var reader = new JsonTextReader(new StreamReader(stream));

            var response        = new List <ServerInformationComplete>(AverageServersCount);
            var currentProperty = string.Empty;

            reader.MatchNext(JsonToken.StartArray);
            while (reader.IsMatchNext(JsonToken.StartObject))
            {
                var entry = new ServerInformationComplete();
                while (reader.Until(JsonToken.EndObject))
                {
                    SetToken(reader, ref currentProperty, entry);
                }

                response.Add(entry);
            }

            return(response.ToArray());
        }