Skip to content

File buffering read stream investigation - #1140

Merged
BobLd merged 4 commits into
masterfrom
file-buffering-read-stream-investigation
Sep 7, 2025
Merged

BobLd merged 4 commits into
masterfrom
file-buffering-read-stream-investigation

Conversation

@EliotJones

Copy link
Copy Markdown
Member

fix #1124 where using a sliding window treated the stream length as exact. certain stream types can return the wrong length if the data isn't yet buffered

the filebufferingreadstream input stream does not report more than the read
length. the change to seek the xref  in a sliding window from the end broke
with the assumption that the reported length was correct. here we switch to
reading the window or continue reading if we can read beyond the stream's
initially reported length while seeking the startxref marker
@EliotJones
EliotJones requested a review from BobLd September 1, 2025 12:54
@BobLd

BobLd commented Sep 2, 2025

Copy link
Copy Markdown
Collaborator

@EliotJones there's a conflict that needs to be resolved, do you mind having a look?

@BobLd
BobLd merged commit dd5aa46 into master Sep 7, 2025
@BobLd
BobLd deleted the file-buffering-read-stream-investigation branch September 7, 2025 13:40
@cremor

cremor commented Sep 7, 2025

Copy link
Copy Markdown

How can this PR fix anything if no code was changed (only a test was added)?
And I'm not even sure if the new test is run in actions because of the #if NET9_0_OR_GREATER since build_and_test.yml doesn't specify .NET 9.

@EliotJones

Copy link
Copy Markdown
Member Author

@cremor the code change was superseded by #1102 but the test was still relevant. Good point on ci we should probably update the targeting soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception thrown: 'Ugly Toad.PdfPig.Core.PdfDocumentFormatException' in Ugly Toad. PdfPig.dll: 'Could not find the startxref' for PdfPig:0.1.11

3 participants