Exemplo n.º 1
0
 public TlsBucket(Bucket reader, IBucketWriter writer, string targetHost, int bufferSize = 16384)
     : base(reader)
 {
     InnerWriter  = writer;
     BufferSize   = bufferSize;
     _inputBuffer = new byte[BufferSize];
     _stream      = new SslStream(Inner.AsStream(InnerWriter));
     _targetHost  = targetHost;
 }
Exemplo n.º 2
0
        public CompressionBucket(Bucket inner, Func <Stream, Stream> compressor) : base(inner.NoClose())
        {
            Src       = Inner.AsStream(new Writer(this));
            Processed = compressor(Src);

            _writeCompression = !Processed.CanRead && Processed.CanWrite;
            if (_writeCompression)
            {
                _written = new AggregateBucket.SimpleAggregate();
            }
        }