Skip to content

Add methods for easier serialization of nested classes in the LengthPrefixedBlock#16

Merged
lukaskabrt merged 5 commits intomasterfrom
feature/block-writing
Jan 11, 2026
Merged

Add methods for easier serialization of nested classes in the LengthPrefixedBlock#16
lukaskabrt merged 5 commits intomasterfrom
feature/block-writing

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 pull request adds new API methods to simplify serialization of nested classes in Protocol Buffers by introducing a structured approach to writing length-prefixed blocks. The version is bumped from 0.3.0 to 0.4.0, indicating a minor release with new features.

Changes:

  • Added three new public methods: WriteRaw, StartLengthPrefixedBlock, and FinalizeLengthPrefixedBlock to support manual length-prefixed block serialization
  • Introduced a LengthPrefixedBlock struct to track block positions during serialization
  • Refactored WriteScalarCollection to use the new length-prefixed block methods

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/PbfLite/PbfLite.csproj Version bump from 0.3.0 to 0.4.0 for the minor release
src/PbfLite/PbfBlockWriter.cs Added WriteRaw, StartLengthPrefixedBlock, FinalizeLengthPrefixedBlock methods and LengthPrefixedBlock struct
src/PbfLite/PbfBlockWriter.Collections.cs Refactored WriteScalarCollection to use new length-prefixed block methods
src/PbfLite.Tests/PbfBlockWriterTests.cs Added test for length-prefixed block functionality with various estimated lengths

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

Copy link
Contributor

Copilot AI commented Jan 11, 2026

@lukaskabrt I've opened a new pull request, #17, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Jan 11, 2026

@lukaskabrt I've opened a new pull request, #18, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits January 11, 2026 11:52
* Initial plan

* Make LengthPrefixedBlock fields readonly using primary constructor

Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com>
* Initial plan

* Add dedicated tests for WriteRaw method

Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com>
@lukaskabrt lukaskabrt merged commit 83dc5af into master Jan 11, 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.

3 participants