Beispiel #1
0
            public void Dispose()
            {
                if (_bytesInPushBuffer != 0)
                {
                    using (var inner = _chunker.BeginChunking(FoundChunk))
                    {
                        inner.PushBuffer(_pushBuffer, 0, _bytesInPushBuffer);
                    }

                    ReportChunks();
                }

                if (_pushBuffer != null)
                {
                    _pushBufferHandle.Dispose();
                    _pushBuffer = null;
                }

                if (_chunksSeen != null)
                {
                    _chunksSeenHandle.Dispose();
                    _chunksSeen = null;
                }
            }
Beispiel #2
0
        /// <inheritdoc />
        protected override void HashCore(byte[] array, int ibStart, int cbSize)
        {
            _chunkingStarted = true;

            if (SingleChunkHotPath)
            {
                _chunkHasher.HashCoreInternal(array, ibStart, cbSize);
            }
            else
            {
                if (_session == null)
                {
                    _session = _chunker.BeginChunking(SaveChunks);
                }
                _session.PushBuffer(array, ibStart, cbSize);
            }

            _bytesChunked += cbSize;
        }
 /// <inheritdoc />
 public override void Initialize()
 {
     _chunks.Clear();
     _session = _chunker.BeginChunking(SaveChunks);
 }