Skip to content

buffer: create relative reading methods #58295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

araujogui
Copy link
Member

@araujogui araujogui commented May 12, 2025

Introduces relative reading methods to Buffer, inspired by similar abstractions in Java and Rust's ByteBuffer. These methods maintain an internal reader index to support sequential reads without manually tracking offsets.

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. needs-ci PRs that need a full CI run. labels May 12, 2025
@araujogui
Copy link
Member Author

Not sure how others feel about this — it adds a bit of complexity to Buffer, so before writing docs or going further, I'd like some feedback

@araujogui araujogui marked this pull request as ready for review May 12, 2025 21:26
Copy link

codecov bot commented May 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.23%. Comparing base (91d2400) to head (023d771).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58295      +/-   ##
==========================================
+ Coverage   90.19%   90.23%   +0.03%     
==========================================
  Files         631      633       +2     
  Lines      186690   186979     +289     
  Branches    36665    36704      +39     
==========================================
+ Hits       168380   168713     +333     
+ Misses      11123    11071      -52     
- Partials     7187     7195       +8     
Files with missing lines Coverage Δ
lib/internal/buffer.js 98.50% <100.00%> (-0.08%) ⬇️

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants