/// <summary> /// /// </summary> public BufferJsonReader(JsonReader reader, Queue <JsonReaderState> stateQueue) : this(reader) { _reader = reader; if (stateQueue != null && stateQueue.Count > 0) { _stateQueue = new Queue <JsonReaderState>(stateQueue.ToArray()); _state = _stateQueue.Dequeue(); } else { _state = null; } }
/// <summary> /// /// </summary> public override bool Read() { if (_state != null && _stateQueue.Count > 0) { _state = _stateQueue.Dequeue(); return(true); } else { _state = null; var result = _reader.Read(); return(result); } }