Пример #1
0
    public ChunkedContentRequestStreamWrapper(IOptions <SimpleS3Config> config, IChunkedSignatureBuilder chunkedSigBuilder, ISignatureBuilder signatureBuilder)
    {
        Validator.RequireNotNull(config, nameof(config));
        Validator.RequireNotNull(chunkedSigBuilder, nameof(chunkedSigBuilder));
        Validator.RequireNotNull(signatureBuilder, nameof(signatureBuilder));

        _chunkedSigBuilder = chunkedSigBuilder;
        _signatureBuilder  = signatureBuilder;
        _config            = config.Value;
    }
        public ChunkedRequestStreamWrapper(IOptions <S3Config> config, IChunkedSignatureBuilder chunkedSigBuilder, ISignatureBuilder signatureBuilder)
        {
            Validator.RequireNotNull(config);
            Validator.RequireNotNull(chunkedSigBuilder);
            Validator.RequireNotNull(signatureBuilder);

            _chunkedSigBuilder = chunkedSigBuilder;
            _signatureBuilder  = signatureBuilder;
            _config            = config;
        }
Пример #3
0
    public ChunkedStream(SimpleS3Config config, IChunkedSignatureBuilder chunkedSigBuilder, IRequest request, byte[] seedSignature, Stream originalStream)
    {
        Validator.RequireNotNull(config, nameof(config));
        Validator.RequireNotNull(chunkedSigBuilder, nameof(chunkedSigBuilder));
        Validator.RequireNotNull(request, nameof(request));
        Validator.RequireNotNull(seedSignature, nameof(seedSignature));
        Validator.RequireNotNull(originalStream, nameof(originalStream));

        _originalStream    = originalStream;
        _chunkedSigBuilder = chunkedSigBuilder;
        _request           = request;
        _seedSignature     = seedSignature;
        _previousSignature = seedSignature;

        _chunkSize = config.StreamingChunkSize;

        _headerSize = CalculateChunkHeaderLength(_chunkSize, seedSignature.Length * 2);
        _buffer     = new byte[_chunkSize + _headerSize + _newline.Length];
    }