Skip to content

Adds PbfStreamReader#15

Merged
lukaskabrt merged 8 commits intomasterfrom
feature/stream-reader
Jan 10, 2026
Merged

Adds PbfStreamReader#15
lukaskabrt merged 8 commits intomasterfrom
feature/stream-reader

Conversation

@lukaskabrt
Copy link
Owner

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new PbfStreamReader class that enables stream-based reading of Protocol Buffers binary data, complementing the existing block-based PbfBlockReader. The implementation extracts shared encoding/decoding logic into a new PbfEncoding helper class to avoid code duplication.

Key Changes

  • Introduces PbfStreamReader with support for reading Protocol Buffers from streams instead of memory blocks
  • Refactors common zigzag decoding and field header encoding/decoding logic into a shared PbfEncoding class
  • Provides comprehensive test coverage including unit tests, system type tests, collection tests, and round-trip tests

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/PbfLite/PbfStreamReader.cs Core stream reader implementation with varint reading, fixed-size reading, and field skipping logic
src/PbfLite/PbfStreamReader.SystemTypes.cs Methods for reading system types (strings, booleans, integers, floats, doubles) from streams
src/PbfLite/PbfStreamReader.Collections.cs Collection reading support for all supported scalar types
src/PbfLite/PbfEncoding.cs Extracted shared encoding/decoding helper methods used by both block and stream readers
src/PbfLite/PbfBlockReader.cs Refactored to remove zigzag methods (moved to PbfEncoding)
src/PbfLite/PbfBlockReader.SystemTypes.cs Updated to use PbfEncoding.Zag for zigzag decoding
src/PbfLite/PbfBlockReader.Collections.cs Refactored to use PbfEncoding.EstimateItemsCount for capacity estimation
src/PbfLite.Tests/PbfStreamReaderTests.cs Unit tests for stream reader core functionality
src/PbfLite.Tests/PbfStreamReaderTests.SystemTypes.cs Tests for system type reading methods
src/PbfLite.Tests/PbfStreamReaderTests.Primitives.cs Tests for primitive varint and fixed-size reading
src/PbfLite.Tests/PbfStreamReaderTests.Collections.cs Tests for collection reading functionality
src/PbfLite.Tests/PbfBlockReaderTests.cs Updated tests to use PbfEncoding.Zag
src/PbfLite.Tests/PbfBlockReaderStreamReaderRoundTripTests.cs Round-trip tests verifying compatibility between block writer and stream reader

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 12 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lukaskabrt lukaskabrt merged commit 30d59a7 into master Jan 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants