buffer-api: expose buffer contents as byte arrays #3696
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 177 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.310
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3696"
general
weight: 0.35
idelpivnitskiy
Motivation
Getting a buffer's bytes currently requires callers to account for readable
offsets and the underlying storage type. A discoverable API on
Buffercentralizes this conversion without requiring an internal utility dependency.
Modifications
Buffer.toByteArrayoverloads. They copy bydefault, preserve reader and writer indices, and validate indexed regions
against the buffer capacity.
array and returns a shared array for all zero-length results.
shared-array cases.
ByteArraySerializer, Jackson deserializers, and Jersey whilepreserving each caller's existing consumption and zero-copy behavior.
BufferUtils, its tests, and its unnecessarydependencies. Restore the unrelated varint test to the PR base version.
Result
Applications and internal callers can obtain byte arrays through a consistent
public
BufferAPI, with copying as the safe default and explicit backing-arrayreuse when requested.
Validation: 1,027 tests passed across the ten affected modules; nine tests were
skipped. Repository compilation, affected-module quality checks, dependency
analysis, documentation validation, and
./gradlew qualitypassed.Closes #863.