-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Feature request: long ReadOnlySequence<T>.GetPosition(SequencePosition) #27158
Comments
/cc @pakrym @davidfowl |
How useful is Position implementation? I imagined that ROS-Stream wrapped would slice ROS for every ReadAsync and discard returned segment. |
A non-seekable would do that, yes. But if you wanted the stream to be seekable, which is certainly allowed given a |
As a workaround, you can do |
Given that the nomenclature uses namespace System
{
public struct ReadOnlySequence<T>
{
public long GetOffset(SequencePosition position);
}
} |
Are we sure about |
long is 9223 petabytes moving to ulong doubles that to 18446 petabytes; they are both fairly big... |
Yep, it's sure enough...formality when I see "on the paper possible" overflow. |
In implementing a
Stream
over aReadOnlySequence<byte>
(see #27156), I find to implement theStream.Position
property getter, I need to translate mySequencePosition
into along
. It's easy enough to translate along
into aSequencePosition
, but there's no built-in way to change it back.I propose the addition of this API:
The text was updated successfully, but these errors were encountered: