You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have needed to *peek* numbers a few times in differing endianness on a SequenceReader. Currently only TryReadLittleEndian and TryReadBigEndian are defined. This proposal aims to add their peeking counterparts.
As there are a few other SequenceReader API proposals awaiting review it seems timely and efficient to propose these apis to be moved into the box as well.
varreader=newSequenceReader(...);if(reader.TryPeekBigEndian(outvarlength))// network data{// Leave the reader at the error position.if(length<-1)thrownewInvalidOperationException("Unexpected length");// Sentinel value does not need to go through full value reading, e.g. it represents absent value.if(lengthis-1){reader.Advance(sizeof(int));returndefault(T);}// ReadValue assumes it can read its own length again.returnReadValue(reader);}
Seems OK to me. @tannergooding, any objections on this or is this worthy of marking as
api-ready-for-reviewAPI is ready for review, it is NOT ready for implementation
and
help wanted[up-for-grabs] Good issue for external contributors
?
@tannergooding assigning to you to drive to closure. I'm supportive of seeking Tactics approval of backporting this into RC1 in the next couple days or RC2.
Activity
dotnet-policy-service commentedon Jun 8, 2025
Tagging subscribers to this area: @dotnet/area-system-buffers
See info in area-owners.md if you want to be subscribed.
NinoFloris commentedon Jul 1, 2025
I believe these are reasonable api additions, could somebody take a look? @jeffhandley maybe?
jeffhandley commentedon Jul 23, 2025
Seems OK to me. @tannergooding, any objections on this or is this worthy of marking as api-ready-for-reviewAPI is ready for review, it is NOT ready for implementation
and
help wanted
[up-for-grabs] Good issue for external contributors
?
NinoFloris commentedon Dec 29, 2025
Early 11.0 ping @tannergooding.
tannergooding commentedon Apr 23, 2026
This may warrant also having the unsigned variants.
bartonjs commentedon May 12, 2026
Video
Looks good as proposed.
If unsigned variants, or offset variants, are needed later, they can come as a separate proposal.
lilinus commentedon Jul 1, 2026
Hasn't been any activity on this one. I can implement it for .NET 11 unless there are objections?
jeffhandley commentedon Aug 17, 2026
@tannergooding assigning to you to drive to closure. I'm supportive of seeking Tactics approval of backporting this into RC1 in the next couple days or RC2.
Add SequenceReaderExtensions.TryPeekEndian (#130178)