Exemplo n.º 1
0
        public Task InitializeAsync(CounterSmugglerOptions options, CancellationToken cancellationToken)
        {
            _gZipStream   = new GZipStream(_stream, CompressionMode.Compress, leaveOpen: true);
            _streamWriter = new StreamWriter(_gZipStream);
            _writer       = new JsonTextWriter(_streamWriter)
            {
                Formatting = Formatting.Indented
            };

            _writer.WriteStartObject();
            return(new CompletedTask());
        }
        public Task InitializeAsync(CounterSmugglerOptions options, CancellationToken cancellationToken)
        {
            _options = options;

            _stream.Position = 0;
            _sizeStream      = new CountingStream(new GZipStream(_stream, CompressionMode.Decompress));
            _streamReader    = new StreamReader(_sizeStream);

            _reader = new RavenJsonTextReader(_streamReader);

            if (_reader.Read() == false)
            {
                return(new CompletedTask());
            }

            if (_reader.TokenType != JsonToken.StartObject)
            {
                throw new InvalidDataException("StartObject was expected");
            }

            return(new CompletedTask());
        }
Exemplo n.º 3
0
 public Task <CounterSmugglerOperationState> LoadOperationStateAsync(CounterSmugglerOptions options, CancellationToken cancellationToken)
 {
     throw new NotSupportedException();
 }