fix: increase RewindableBufferSize to 160KB to cover ZStandard worst-case first block

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-17 12:25:29 +00:00
parent 4d6478454d
commit d56b676ee9
2 changed files with 6 additions and 3 deletions

View File

@@ -22,7 +22,9 @@ public static class Constants
/// by rewinding and re-reading the same data.
/// </para>
/// <para>
/// <b>Default:</b> 81920 bytes (81KB) - sufficient for typical format detection.
/// <b>Default:</b> 163840 bytes (160KB) - sized to cover ZStandard's worst-case
/// first block on a tar archive (~131KB including frame header overhead).
/// ZStandard blocks can be up to 128KB, exceeding the previous 81KB default.
/// </para>
/// <para>
/// <b>Typical usage:</b> 500-1000 bytes for most archives
@@ -39,7 +41,7 @@ public static class Constants
/// </list>
/// </para>
/// </remarks>
public static int RewindableBufferSize { get; set; } = 81920;
public static int RewindableBufferSize { get; set; } = 163840;
public static CultureInfo DefaultCultureInfo { get; set; } = CultureInfo.InvariantCulture;
}

View File

@@ -76,7 +76,8 @@ public sealed record ReaderOptions : IReaderOptions
/// by rewinding and re-reading the same data.
/// </para>
/// <para>
/// <b>Default:</b> Constants.RewindableBufferSize (81920 bytes / 81KB)
/// <b>Default:</b> Constants.RewindableBufferSize (163840 bytes / 160KB) - sized to cover
/// ZStandard's worst-case first block on a tar archive (~131KB including header overhead).
/// </para>
/// <para>
/// <b>Typical usage:</b> 500-1000 bytes for most archives