示例#1
0
            public void Dispose()
            {
                _tokenizer.Dispose();
                _tokenizer = null !;

                Current = null !;
            }
 /// <summary>
 /// Releases all resources used by the <see cref="SerializedObjectReader" />.
 /// </summary>
 public void Dispose()
 {
     m_BinaryWriter.Dispose();
     if (!m_LeaveOutputOpen)
     {
         m_BinaryStream.Dispose();
     }
     m_Parser.Dispose();
     m_Tokenizer.Dispose();
     m_StreamReader.Dispose();
 }
示例#3
0
        private static JsonData Parse(JsonReader reader)
        {
            if (_buffer == null)
            {
                _buffer = new StringBuilder(200);
            }

            var tokenizer = new JsonTokenizer(reader, _buffer);

            tokenizer.MoveNext();

            var result = Visit(ref tokenizer);

            tokenizer.Dispose();

            return(result);
        }
示例#4
0
        private TOut Deserialize <TOut>(JsonReader reader)
        {
            if (_buffer == null)
            {
                _buffer = new StringBuilder(200);
            }

            var converter = _converters.Get <TOut>();

            var tokenizer = new JsonTokenizer(reader, _buffer);

            if (converter.IsPrimitive)
            {
                tokenizer.MoveNext();
            }

            var result = converter.Deserialize(ref tokenizer);

            tokenizer.Dispose();

            return(result);
        }
 public void TearDown()
 {
     m_Tokenizer.Dispose();
 }