Repository navigation
Conversation
negative origins can place source data at a later virtual offset. read zero-filled padding without seeking before the source, and limit padding to the requested length and configured stream size.
|
@kisnner26 thank you for your contribution! As this is your first code contribution, please read the following Contributor License Agreement (CLA). If you agree with the CLA, please reply with the following information:
Contributor License Agreement
Contribution License AgreementThis Contribution License Agreement ("Agreement") governs your Contribution(s) (as defined below) and conveys certain license rights to Fox-IT B.V. ("Fox-IT") for your Contribution(s) to Fox-IT"s open source Dissect project. This Agreement covers any and all Contributions that you ("You" or "Your"), now or in the future, Submit (as defined below) to this project. This Agreement is between Fox-IT B.V. and You and takes effect when you click an “I Accept” button, check box presented with these terms, otherwise accept these terms or, if earlier, when You Submit a Contribution.
|
fixes #126.
allow a negative
RelativeStreamoffset to insert a zero-filled prefix before the source data. aligned reads that begin before the source no longer try to seek to a negative position. padding is limited to the requested length and configured stream size, and only the remaining bytes are read from the source.positive offsets retain the existing
RangeStreamread path. the docstring explains negative offsets and that an explicit size includes the prefix.validation: all 18 new parameterized cases fail before the change. after the change,
tests/test_stream.pypasses 30 tests with two benchmark tests skipped because the benchmark plugin is absent. tests cover multiple prefix lengths and alignments, partial/boundary reads, consecutive reads, eof, seek-from-end, unknown-size streams and an explicit size ending inside the prefix. ruff lint/format, vermin compatibility checks andgit diff --checkpass for the changed files. git-lfs is unavailable locally, so this validation uses the in-memory stream tests rather than the unrelated lfs-backed archive fixtures.