diff --git a/src/SharpCompress/IO/CountingWritableSubStream.cs b/src/SharpCompress/IO/CountingWritableSubStream.cs index 35e2e5f3..3c1d9393 100644 --- a/src/SharpCompress/IO/CountingWritableSubStream.cs +++ b/src/SharpCompress/IO/CountingWritableSubStream.cs @@ -41,7 +41,7 @@ namespace SharpCompress.IO public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { await Stream.WriteAsync(buffer, offset, count, cancellationToken); - Count += (uint)buffer.Length; + Count += (uint)count; } public override async ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default)