Update src/SharpCompress/IO/PooledMemoryStream.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Adam Hathcock
2026-04-19 12:18:47 +01:00
committed by GitHub
parent ad3c5dafd7
commit 891d1268fb

View File

@@ -81,8 +81,8 @@ public sealed class PooledMemoryStream : MemoryStream
}
set
{
ThrowHelper.ThrowIfNegative(value, nameof(value));
EnsureNotClosed();
ThrowHelper.ThrowIfNegative(value, nameof(value));
ThrowHelper.ThrowIfGreaterThan(value, MaxStreamLength, nameof(value));
_position = (int)value;