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; } }
/// <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); }