31 instantiations of SequencePosition
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (6)
BodyControlTests.cs (6)
95Assert.Throws<Exception>(() => requestPipe.AdvanceTo(new SequencePosition()))); 97Assert.Throws<Exception>(() => requestPipe.AdvanceTo(new SequencePosition(), new SequencePosition()))); 115Assert.Throws<ObjectDisposedException>(() => requestPipe.AdvanceTo(new SequencePosition())); 116Assert.Throws<ObjectDisposedException>(() => requestPipe.AdvanceTo(new SequencePosition(), new SequencePosition()));
System.Memory (16)
System\Buffers\ReadOnlySequence.cs (10)
63get => new SequencePosition(_startObject, GetIndex(_startInteger)); 72get => new SequencePosition(_endObject, GetIndex(_endInteger)); 214begin = new SequencePosition(startObject, startIndex); 238end = new SequencePosition(beginObject, beginIndex + (int)length); 248begin = new SequencePosition(startObject, startIndex); 253end = new SequencePosition(startObject, startIndex + (int)length); 335return SliceImpl(new SequencePosition(startObject, (int)startIndex + (int)start), new SequencePosition(sliceEndObject, (int)sliceEndIndex)); 418return SliceImpl(new SequencePosition(sliceStartObject, (int)sliceStartIndex), new SequencePosition(sliceStartObject, (int)sliceStartIndex + (int)length));
System\Buffers\ReadOnlySequence.Helpers.cs (6)
43next = new SequencePosition(nextSegment, 0); 267return new SequencePosition(startObject, startIndex + (int)offset); 303return new SequencePosition(startObject, startIndex + (int)offset); 330return new SequencePosition(currentSegment, (int)offset); 429return new SequencePosition(startObject, startIndex + (int)length); 652next = new SequencePosition(segment.Next, 0);
System.Text.Json (9)
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (9)
597SequencePosition start = new SequencePosition(startPosition.GetObject(), startPosition.GetInteger() + startConsumed); 598SequencePosition end = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + leftToMatch.Length); 818end = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + idx); 935end = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + idx); 1085end = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + idx); 1238SequencePosition end = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + i); 2181SequencePosition start = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + _consumed); 2192SequencePosition end = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + _consumed); 2621return new SequencePosition(_prevCurrentPosition.GetObject(), _prevCurrentPosition.GetInteger() + _prevConsumed + offset);
353 references to SequencePosition
Aspire.Hosting (2)
Dcp\DcpHostService.cs (2)
339void LogLines(in ReadOnlySequence<byte> buffer, out SequencePosition position) 361LogLines(result.Buffer, out var position);
ClientSample (1)
Tcp\TcpConnection.cs (1)
229var end = buffer.End;
http2cat (4)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
IIS.FunctionalTests (4)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
IIS.LongTests (4)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
IIS.NewHandler.FunctionalTests (4)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
IIS.NewShim.FunctionalTests (4)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
IIS.ShadowCopy.Tests (4)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
IISExpress.FunctionalTests (4)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
InMemory.FunctionalTests (19)
Http2\TlsTests.cs (2)
111var consumed = buffer.Start; 112var examined = buffer.Start;
Http3\WebTransport\WebTransportTestUtilities.cs (3)
170public override void AdvanceTo(SequencePosition consumed) 175public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
src\Servers\Kestrel\shared\CompletionPipeReader.cs (3)
23public override void AdvanceTo(SequencePosition consumed) 28public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (5)
553var consumed = buffer.Start; 554var examined = buffer.Start; 847var id = VariableLengthIntegerHelper.GetInteger(payload, out var consumed, out _); 930var consumed = readableBuffer.Start; 931var examined = readableBuffer.End;
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (3)
70public override void AdvanceTo(SequencePosition consumed) => _input.AdvanceTo(consumed); 72public override void AdvanceTo(SequencePosition consumed, SequencePosition examined) => _input.AdvanceTo(consumed, examined);
TestTransport\InMemoryTransportConnection.cs (3)
127public override void AdvanceTo(SequencePosition consumed) 132public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
Microsoft.AspNetCore.Components.Server (9)
BlazorPack\SequenceOfT.cs (2)
121public void AdvanceTo(SequencePosition position) 309/// <remarks>This may be nonzero as a result of calling <see cref="Sequence{T}.AdvanceTo(SequencePosition)"/>.</remarks>
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (2)
74public SequencePosition Position => this.reader.Position; 291SequencePosition initialPosition = this.Position;
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (5)
31private SequencePosition currentPosition; 36private SequencePosition nextPosition; 128public SequencePosition Position 308SequencePosition previousNextPosition = this.nextPosition; 478SequencePosition next = this.nextPosition;
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (2)
ServerStreamingServerCallHandlerTests.cs (2)
270if ((str = ReadLine(ref buffer, out var end)) is not null) 287private static string? ReadLine(ref ReadOnlySequence<byte> buffer, out SequencePosition end)
Microsoft.AspNetCore.Http.Connections (3)
ServerSentEventsMessageFormatter.cs (1)
51var position = source.Start;
src\SignalR\common\Shared\StreamExtensions.cs (1)
33var position = buffer.Start;
src\SignalR\common\Shared\WebSocketExtensions.cs (1)
41var position = buffer.Start;
Microsoft.AspNetCore.Http.Connections.Client (2)
src\SignalR\common\Shared\StreamExtensions.cs (1)
33var position = buffer.Start;
src\SignalR\common\Shared\WebSocketExtensions.cs (1)
41var position = buffer.Start;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (4)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
Microsoft.AspNetCore.Server.IIS (4)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
Microsoft.AspNetCore.Server.Kestrel.Core (58)
Internal\Http\Http1ChunkedEncodingMessageBody.cs (18)
36public override void AdvanceTo(SequencePosition consumed, SequencePosition examined) 114var consumed = readableBuffer.Start; 115var examined = readableBuffer.Start; 202private bool Read(ReadOnlySequence<byte> readableBuffer, PipeWriter writableBuffer, out SequencePosition consumed, out SequencePosition examined) 291private void ParseChunkedPrefix(in ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined) 348private void ParseExtension(ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined) 356SequencePosition? extensionCursorPosition = buffer.PositionOf(ByteCR); 366var extensionCursor = extensionCursorPosition.Value; 400private void ReadChunkedData(in ReadOnlySequence<byte> buffer, PipeWriter writableBuffer, out SequencePosition consumed, out SequencePosition examined) 417private void ParseChunkedSuffix(in ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined) 445private void ParseChunkedTrailer(in ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
Internal\Http\Http1ContentLengthMessageBody.cs (2)
204public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
Internal\Http\Http1UpgradeMessageBody.cs (2)
38public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
Internal\Http\HttpParser.cs (1)
340SequencePosition position = currentSlice.Start;
Internal\Http\HttpRequestPipeReader.cs (3)
24public override void AdvanceTo(SequencePosition consumed) 31public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
Internal\Http\HttpRequestStream.cs (1)
128var consumed = buffer.End;
Internal\Http\MessageBody.cs (5)
52public void AdvanceTo(SequencePosition consumed) 57public abstract void AdvanceTo(SequencePosition consumed, SequencePosition examined); 261protected long TrackConsumedAndExaminedBytes(ReadResult readResult, SequencePosition consumed, SequencePosition examined)
Internal\Http\ZeroContentLengthMessageBody.cs (2)
24public override void AdvanceTo(SequencePosition consumed, SequencePosition examined) { }
Internal\Http2\Http2Connection.cs (4)
555var consumed = readableBuffer.Start; 556var examined = readableBuffer.End; 658private static bool IsPreface(in ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
Internal\Http2\Http2MessageBody.cs (2)
66public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
Internal\Http3\Http3ControlStream.cs (5)
155var consumed = readableBuffer.Start; 156var examined = readableBuffer.End; 254var consumed = readableBuffer.Start; 255var examined = readableBuffer.End; 336var id = VariableLengthIntegerHelper.GetInteger(payload, out var consumed, out _);
Internal\Http3\Http3FrameReader.cs (1)
25SequencePosition consumed;
Internal\Http3\Http3MessageBody.cs (2)
42public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
Internal\Http3\Http3PendingStream.cs (2)
44SequencePosition consumed = default; 45SequencePosition start = default;
Internal\Http3\Http3Stream.cs (2)
616var consumed = readableBuffer.Start; 617var examined = readableBuffer.End;
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (2)
131public static long GetInteger(in ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (51)
BodyControlTests.cs (2)
149public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
Http1\Http1ConnectionTests.cs (12)
123SequencePosition TakeStartLineAndMessageHeaders() 138SequencePosition TakeMessageHeaders() 200SequencePosition consumed = read.Buffer.Start; 201SequencePosition examined = read.Buffer.End; 218static bool TryReadResponse(ReadResult read, out SequencePosition consumed, out SequencePosition examined) 1040private bool TakeMessageHeaders(ReadOnlySequence<byte> readableBuffer, bool trailers, out SequencePosition consumed, out SequencePosition examined) 1057private bool TakeStartLine(ReadOnlySequence<byte> readableBuffer, out SequencePosition consumed, out SequencePosition examined) 1074private bool ParseRequest(ReadOnlySequence<byte> readableBuffer, out SequencePosition consumed, out SequencePosition examined)
Http1\Http1ConnectionTestsBase.cs (2)
26internal SequencePosition _consumed; 27internal SequencePosition _examined;
HttpParserTests.cs (28)
41Assert.True(ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 60Assert.False(ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 71Assert.False(ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 88ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 108Assert.True(ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 122ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 141ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 169ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 187ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 530ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 541ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined)); 570var result = ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined); 589ParseRequestLine(parser, requestHandler, buffer, out var consumed, out var examined); 798private bool ParseRequestLine(IHttpParser<RequestHandler> parser, RequestHandler requestHandler, ReadOnlySequence<byte> readableBuffer, out SequencePosition consumed, out SequencePosition examined)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (3)
70public override void AdvanceTo(SequencePosition consumed) => _input.AdvanceTo(consumed); 72public override void AdvanceTo(SequencePosition consumed, SequencePosition examined) => _input.AdvanceTo(consumed, examined);
src\Shared\test\Shared.Tests\runtime\Http3\VariableLengthIntegerHelperTests.cs (4)
227out SequencePosition consumed, out SequencePosition examined); 242out SequencePosition consumed, out SequencePosition examined);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (12)
Http2\Http2ConnectionBenchmarkBase.cs (2)
158var consumed = buffer.Start; 159var examined = buffer.Start;
InMemoryTransportBenchmark.cs (2)
215var consumed = buffer.Start; 216var examined = buffer.End;
src\Servers\Kestrel\shared\CompletionPipeReader.cs (3)
23public override void AdvanceTo(SequencePosition consumed) 28public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (5)
553var consumed = buffer.Start; 554var examined = buffer.Start; 847var id = VariableLengthIntegerHelper.GetInteger(payload, out var consumed, out _); 930var consumed = readableBuffer.Start; 931var examined = readableBuffer.End;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (4)
Internal\QuicStreamContext.cs (1)
399var end = buffer.End;
src\Servers\Kestrel\shared\CompletionPipeReader.cs (3)
23public override void AdvanceTo(SequencePosition consumed) 28public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
Microsoft.AspNetCore.Shared.Tests (10)
runtime\Http3\VariableLengthIntegerHelperTests.cs (4)
227out SequencePosition consumed, out SequencePosition examined); 242out SequencePosition consumed, out SequencePosition examined);
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (2)
131public static long GetInteger(in ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
70public static SequencePosition? PositionOfAny<T>(in this ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 88private static SequencePosition? PositionOfAnyMultiSegment<T>(in ReadOnlySequence<T> source, T value0, T value1) where T : IEquatable<T> 90SequencePosition position = source.Start; 91SequencePosition result = position;
Microsoft.AspNetCore.SignalR.Client.Core (2)
HubConnection.cs (2)
1513var consumed = buffer.Start; 1514var examined = buffer.End;
Microsoft.AspNetCore.SignalR.Client.Tests (1)
TestConnection.cs (1)
150var consumed = buffer.Start;
Microsoft.AspNetCore.SignalR.Core (2)
HubConnectionContext.cs (2)
513var consumed = buffer.Start; 514var examined = buffer.End;
Microsoft.AspNetCore.SignalR.Microbenchmarks (4)
Shared\TestPipeReader.cs (3)
17public override void AdvanceTo(SequencePosition consumed) 21public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
src\SignalR\common\Http.Connections\src\ServerSentEventsMessageFormatter.cs (1)
51var position = source.Start;
Microsoft.AspNetCore.SignalR.Tests (3)
HubConnectionHandlerTests.cs (3)
2944public override void AdvanceTo(SequencePosition consumed) => 2947public override void AdvanceTo(SequencePosition consumed, SequencePosition examined) =>
Microsoft.AspNetCore.WebUtilities (1)
FormPipeReader.cs (1)
242var consumed = sequenceReader.Position;
mscorlib (1)
mscorlib.cs (1)
30[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.SequencePosition))]
netstandard (1)
netstandard.cs (1)
2012[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.SequencePosition))]
Sockets.FunctionalTests (6)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (3)
70public override void AdvanceTo(SequencePosition consumed) => _input.AdvanceTo(consumed); 72public override void AdvanceTo(SequencePosition consumed, SequencePosition examined) => _input.AdvanceTo(consumed, examined);
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (3)
97public override void AdvanceTo(SequencePosition consumed) 102public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
System.IO.Pipelines (22)
System\IO\Pipelines\Pipe.cs (3)
448internal void AdvanceReader(in SequencePosition consumed) 453internal void AdvanceReader(in SequencePosition consumed, in SequencePosition examined)
System\IO\Pipelines\Pipe.DefaultPipeReader.cs (3)
28public override void AdvanceTo(SequencePosition consumed) => _pipe.AdvanceReader(consumed); 30public override void AdvanceTo(SequencePosition consumed, SequencePosition examined) => _pipe.AdvanceReader(consumed, examined);
System\IO\Pipelines\PipeReader.cs (9)
47/// Subsequent calls to <see cref="System.IO.Pipelines.PipeReader.AdvanceTo(System.SequencePosition,System.SequencePosition)" /> should 87/// This is equivalent to calling <see cref="System.IO.Pipelines.PipeReader.AdvanceTo(System.SequencePosition,System.SequencePosition)" /> with identical examined and consumed positions. 90public abstract void AdvanceTo(SequencePosition consumed); 98public abstract void AdvanceTo(SequencePosition consumed, SequencePosition examined); 238SequencePosition position = buffer.Start; 239SequencePosition consumed = position;
System\IO\Pipelines\PipeReaderStream.cs (1)
120SequencePosition consumed = sequence.Start;
System\IO\Pipelines\SequencePipeReader.cs (3)
23public override void AdvanceTo(SequencePosition consumed) 29public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
System\IO\Pipelines\StreamPipeReader.cs (3)
69public override void AdvanceTo(SequencePosition consumed) 86public override void AdvanceTo(SequencePosition consumed, SequencePosition examined)
System.Memory (72)
System\Buffers\BuffersExtensions.cs (5)
17public static SequencePosition? PositionOf<T>(in this ReadOnlySequence<T> source, T value) where T : IEquatable<T>? 35private static SequencePosition? PositionOfMultiSegment<T>(in ReadOnlySequence<T> source, T value) where T : IEquatable<T>? 37SequencePosition position = source.Start; 38SequencePosition result = position; 83SequencePosition position = sequence.Start;
System\Buffers\ReadOnlySequence.cs (31)
60public SequencePosition Start 69public SequencePosition End 194SequencePosition begin; 195SequencePosition end; 263/// <param name="end">The ending (exclusive) <see cref="SequencePosition"/> of the slice.</param> 265public ReadOnlySequence<T> Slice(long start, SequencePosition end) 328SequencePosition begin = SeekMultiSegment(startSegment.Next!, sliceEndObject, (int)sliceEndIndex, start - currentLength, ExceptionArgument.start); 341/// <param name="start">The starting (inclusive) <see cref="SequencePosition"/> at which to begin this slice.</param> 344public ReadOnlySequence<T> Slice(SequencePosition start, long length) 411SequencePosition end = SeekMultiSegment(sliceStartSegment.Next!, endObject, (int)endIndex, length - currentLength, ExceptionArgument.length); 433/// <param name="end">The ending (exclusive) <see cref="SequencePosition"/> of the slice.</param> 435public ReadOnlySequence<T> Slice(int start, SequencePosition end) => Slice((long)start, end); 440/// <param name="start">The starting (inclusive) <see cref="SequencePosition"/> at which to begin this slice.</param> 443public ReadOnlySequence<T> Slice(SequencePosition start, int length) => Slice(start, (long)length); 448/// <param name="start">The starting (inclusive) <see cref="SequencePosition"/> at which to begin this slice.</param> 449/// <param name="end">The ending (exclusive) <see cref="SequencePosition"/> of the slice.</param> 452public ReadOnlySequence<T> Slice(SequencePosition start, SequencePosition end) 461/// <param name="start">The starting (inclusive) <see cref="SequencePosition"/> at which to begin this slice.</param> 464public ReadOnlySequence<T> Slice(SequencePosition start) 484SequencePosition begin = Seek(start, ExceptionArgument.start); 516/// Returns a new <see cref="SequencePosition"/> at an <paramref name="offset"/> from the start of the sequence. 518public SequencePosition GetPosition(long offset) 529/// <param name="position">The <see cref="System.SequencePosition"/> of which to get the offset.</param> 532public long GetOffset(SequencePosition position) 585/// Returns a new <see cref="SequencePosition"/> at an <paramref name="offset"/> from the <paramref name="origin"/> 587public SequencePosition GetPosition(long offset, SequencePosition origin) 600public bool TryGet(ref SequencePosition position, out ReadOnlyMemory<T> memory, bool advance = true) 602bool result = TryGetBuffer(position, out memory, out SequencePosition next); 617private SequencePosition _next;
System\Buffers\ReadOnlySequence.Helpers.cs (12)
14internal bool TryGetBuffer(in SequencePosition position, out ReadOnlyMemory<T> memory, out SequencePosition next) 235internal SequencePosition Seek(long offset, ExceptionArgument exceptionArgument = ExceptionArgument.offset) 271private SequencePosition Seek(in SequencePosition start, long offset) 307private static SequencePosition SeekMultiSegment(ReadOnlySequenceSegment<T>? currentSegment, object endObject, int endIndex, long offset, ExceptionArgument argument) 333private void BoundsCheck(in SequencePosition position, bool positionIsNotNull) 423private static SequencePosition GetEndPosition(ReadOnlySequenceSegment<T> startSegment, object startObject, int startIndex, object endObject, int endIndex, long length) 467private ReadOnlySequence<T> SliceImpl(in SequencePosition start, in SequencePosition end) 482private ReadOnlySequence<T> SliceImpl(in SequencePosition start) 630internal void GetFirstSpan(out ReadOnlySpan<T> first, out SequencePosition next)
System\Buffers\SequenceReader.cs (6)
11private SequencePosition _currentPosition; 12private SequencePosition _nextPosition; 60public readonly SequencePosition Position 161SequencePosition nextPosition = _nextPosition; 289SequencePosition previousNextPosition = _nextPosition; 438SequencePosition next = _nextPosition;
System\Buffers\SequenceReader.Search.cs (1)
812SequencePosition nextPosition = _nextPosition;
System\SequencePosition.cs (11)
13public readonly struct SequencePosition : IEquatable<SequencePosition> 19/// Creates new <see cref="SequencePosition"/> 28/// Returns object part of this <see cref="SequencePosition"/> 34/// Returns integer part of this <see cref="SequencePosition"/> 40/// Indicates whether the current <see cref="SequencePosition"/> is equal to another <see cref="SequencePosition"/>. 41/// <see cref="SequencePosition"/> equality does not guarantee that they point to the same location in <see cref="System.Buffers.ReadOnlySequence{T}" /> 43public bool Equals(SequencePosition other) => _integer == other._integer && object.Equals(this._object, other._object); 46/// Indicates whether the current <see cref="SequencePosition"/> is equal to another <see cref="object"/>. 47/// <see cref="SequencePosition"/> equality does not guarantee that they point to the same location in <see cref="System.Buffers.ReadOnlySequence{T}" /> 50public override bool Equals([NotNullWhen(true)] object? obj) => obj is SequencePosition other && this.Equals(other);
System\Text\EncodingExtensions.cs (6)
122remainingChars.GetFirstSpan(out ReadOnlySpan<char> firstSpan, out SequencePosition next); 174remainingChars.GetFirstSpan(out ReadOnlySpan<char> firstSpan, out SequencePosition next); 313remainingBytes.GetFirstSpan(out ReadOnlySpan<byte> firstSpan, out SequencePosition next); 361remainingBytes.GetFirstSpan(out ReadOnlySpan<byte> firstSpan, out SequencePosition next); 480remainingChars.GetFirstSpan(out ReadOnlySpan<char> firstSpan, out SequencePosition next); 574remainingBytes.GetFirstSpan(out ReadOnlySpan<byte> firstSpan, out SequencePosition next);
System.Net.Http (2)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (2)
131public static long GetInteger(in ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
System.Text.Json (27)
System\Text\Json\Reader\Utf8JsonReader.cs (5)
45private SequencePosition _nextPosition; 46private SequencePosition _currentPosition; 163/// Returns the current <see cref="SequencePosition"/> within the provided UTF-8 encoded 165/// with a ReadOnlySpan&lt;byte&gt; instead, this will always return a default <see cref="SequencePosition"/>. 167public readonly SequencePosition Position
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (22)
73SequencePosition previousNextPosition = _nextPosition; 179SequencePosition copy = _currentPosition; 304SequencePosition copy = _currentPosition; 445SequencePosition copy = _currentPosition; 458SequencePosition copy = _currentPosition; 546SequencePosition copy = _currentPosition; 569SequencePosition startPosition = _currentPosition; 597SequencePosition start = new SequencePosition(startPosition.GetObject(), startPosition.GetInteger() + startConsumed); 598SequencePosition end = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + leftToMatch.Length); 791SequencePosition end; 944SequencePosition start = rollBackState.GetStartPosition(offset: 1); // Offset for the starting quote 961SequencePosition end; 1086SequencePosition start = rollBackState.GetStartPosition(offset: 1); // Offset for the starting quote 1237SequencePosition start = rollBackState.GetStartPosition(); 1238SequencePosition end = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + i); 1531SequencePosition prevSequencePosition = _currentPosition; 2033SequencePosition copy = _currentPosition; 2181SequencePosition start = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + _consumed); 2192SequencePosition end = new SequencePosition(_currentPosition.GetObject(), _currentPosition.GetInteger() + _consumed); 2609public readonly SequencePosition _prevCurrentPosition; 2611public PartialStateForRollback(long totalConsumed, long bytePositionInLine, int consumed, SequencePosition currentPosition) 2619public SequencePosition GetStartPosition(int offset = 0)