32 instantiations of ReadOnlySequence
Microsoft.AspNetCore.Components (1)
PersistentState\PersistentValueProviderComponentSubscription.cs (1)
144
var sequence = new
ReadOnlySequence
<byte>(data!);
Microsoft.AspNetCore.Components.Forms (1)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
153
var sequence = new
ReadOnlySequence
<char>(this, startIndex, tail, tail.Memory.Length);
Microsoft.AspNetCore.Components.Server (3)
BlazorPack\SequenceOfT.cs (1)
109
? new
ReadOnlySequence
<T>(sequence.first, sequence.first.Start, sequence.last, sequence.last.End)
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\ExtensionResult.cs (1)
19
this.Data = new
ReadOnlySequence
<byte>(data);
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (1)
116
this.sequence = new
ReadOnlySequence
<T>(this.memory);
Microsoft.AspNetCore.Components.Web (1)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
153
var sequence = new
ReadOnlySequence
<char>(this, startIndex, tail, tail.Memory.Length);
Microsoft.AspNetCore.HttpLogging (1)
BufferingStream.cs (1)
64
var ros = new
ReadOnlySequence
<byte>(_head, 0, _tail, _tailBytesBuffered);
Microsoft.AspNetCore.OutputCaching (8)
OutputCacheEntryFormatter.cs (4)
49
await bufferStore.SetAsync(key,
new
(buffer.GetCommittedMemory()), CopyToLeasedMemory(tags, out var lease), duration, cancellationToken);
319
result.SetBody(new
ReadOnlySequence
<byte>(ReadSegment(ref reader)), recycleBuffers: false); // we're reusing the live payload buffers
329
result.SetBody(new
ReadOnlySequence
<byte>(first, 0, last, last.Length), recycleBuffers: false); // we're reusing the live payload buffers
369
result.SetBody(
new
(reader.ReadBytesMemory(payloadLength)), recycleBuffers: false); // we're reusing the live payload buffers
RecyclableReadOnlySequenceSegment.cs (2)
91
return
new
(segments[0]);
98
return
new
(first, 0, last, last.Length);
RecyclableSequenceBuilder.cs (2)
44
return
new
(memory);
48
var payload = new
ReadOnlySequence
<byte>(_firstSegment, 0, _currentSegment!, _currentSegmentIndex);
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\Http\Http1ContentLengthMessageBody.cs (1)
221
_readResult = new ReadResult(new
ReadOnlySequence
<byte>(), isCanceled: false, isCompleted: true);
Internal\Http2\Http2KeepAlive.cs (1)
24
internal static readonly ReadOnlySequence<byte> PingPayload = new
ReadOnlySequence
<byte>(new byte[8]);
Microsoft.AspNetCore.SignalR.Common (1)
Protocol\RawResult.cs (1)
30
RawSerializedData = new
ReadOnlySequence
<byte>(rawBytes.ToArray());
Microsoft.Extensions.Caching.Hybrid (3)
Internal\BufferChunk.cs (1)
92
internal ReadOnlySequence<byte> AsSequence() => Length == 0 ? default : new
ReadOnlySequence
<byte>(OversizedArray!, Offset, Length);
Internal\DefaultHybridCache.StampedeStateT.cs (1)
449
immutable.SetValue(serializer.Deserialize(
new
(value.OversizedArray!, value.Offset, value.Length)), value.Length);
Internal\RecyclableArrayBufferWriter.cs (1)
134
public ReadOnlySequence<T> AsSequence() =>
new
(_buffer, 0, _index);
Microsoft.Extensions.Caching.Hybrid.Tests (5)
DistributedCacheTests.cs (4)
286
payload =
new
(arr);
291
payload =
new
(arr, 5, arr.Length - 10);
295
payload =
new
(mem);
312
payload =
new
(first, 7, third, 4);
SerializerTests.cs (1)
316
var result = new
ReadOnlySequence
<byte>(first, 0, second, chunk.Length - 1);
System.IO.Pipelines (2)
System\IO\Pipelines\Pipe.cs (1)
973
var readOnlySequence = new
ReadOnlySequence
<byte>(head, _readHeadIndex, _readTail, _readTailIndex);
System\IO\Pipelines\StreamPipeReader.cs (1)
485
return _readHead is null ? default : new
ReadOnlySequence
<byte>(_readHead, _readIndex, _readTail!, _readTail!.End);
System.Memory (3)
System\Buffers\ReadOnlySequence.cs (1)
26
public static readonly ReadOnlySequence<T> Empty = new
ReadOnlySequence
<T>(Array.Empty<T>());
System\Buffers\ReadOnlySequence.Helpers.cs (2)
473
return new
ReadOnlySequence
<T>(
488
return new
ReadOnlySequence
<T>(
System.Text.Json (1)
System\Text\Json\Serialization\StreamReadBufferState.cs (1)
55
public readonly ReadOnlySequence<byte> Bytes =>
new
(_buffer.AsMemory(_offset, _count));
417 references to ReadOnlySequence
Aspire.Dashboard (1)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (1)
250
Func<
ReadOnlySequence
<byte>, T> exporter)
Aspire.Hosting (1)
Dcp\DcpHost.cs (1)
387
void LogLines(in
ReadOnlySequence
<byte> buffer, out SequencePosition position)
Microsoft.AspNetCore.Components (4)
IPersistentComponentStateSerializer.cs (1)
11
object Restore(Type type,
ReadOnlySequence
<byte> data);
PersistentState\PersistentComponentStateSerializer.cs (2)
27
public abstract T Restore(
ReadOnlySequence
<byte> data);
38
object IPersistentComponentStateSerializer.Restore(Type type,
ReadOnlySequence
<byte> data)
PersistentState\PersistentValueProviderComponentSubscription.cs (1)
144
var
sequence = new ReadOnlySequence<byte>(data!);
Microsoft.AspNetCore.Components.Forms (1)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
153
var
sequence = new ReadOnlySequence<char>(this, startIndex, tail, tail.Memory.Length);
Microsoft.AspNetCore.Components.Server (43)
BlazorPack\BlazorPackHubProtocol.cs (1)
39
public bool TryParseMessage(ref
ReadOnlySequence
<byte> input, IInvocationBinder binder, out HubMessage message)
BlazorPack\SequenceOfT.cs (9)
14
/// Manages a sequence of elements, readily castable as a <see cref="
ReadOnlySequence
{T}"/>.
87
/// Gets this sequence expressed as a <see cref="
ReadOnlySequence
{T}"/>.
90
public
ReadOnlySequence
<T> AsReadOnlySequence => this;
103
/// Expresses this sequence as a <see cref="
ReadOnlySequence
{T}"/>.
106
public static implicit operator
ReadOnlySequence
<T>(Sequence<T> sequence)
110
:
ReadOnlySequence
<T>.Empty;
119
/// This is typically <see cref="
ReadOnlySequence
{T}.End"/> after reading all elements from that instance.
189
/// This invalidates any <see cref="
ReadOnlySequence
{T}"/> previously produced by this instance.
196
/// This invalidates any <see cref="
ReadOnlySequence
{T}"/> previously produced by this instance.
src\aspnetcore\src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (2)
28
public bool TryParseMessage(ref
ReadOnlySequence
<byte> input, IInvocationBinder binder, [NotNullWhen(true)] out HubMessage? message)
30
if (!BinaryMessageParser.TryParseMessage(ref input, out
var
payload))
src\aspnetcore\src\SignalR\common\Shared\BinaryMessageParser.cs (4)
13
public static bool TryParseMessage(ref
ReadOnlySequence
<byte> buffer, out
ReadOnlySequence
<byte> payload)
36
var
lengthPrefixBuffer = buffer.Slice(0, Math.Min(MaxLengthPrefixSize, buffer.Length));
75
private static ReadOnlySpan<byte> GetSpan(in
ReadOnlySequence
<byte> lengthPrefixBuffer)
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\ExtensionResult.cs (2)
22
public ExtensionResult(sbyte typeCode,
ReadOnlySequence
<byte> data)
30
public
ReadOnlySequence
<byte> Data { get; private set; }
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (13)
49
public MessagePackReader(in
ReadOnlySequence
<byte> readOnlySequence)
67
/// Gets the <see cref="
ReadOnlySequence
{T}"/> originally supplied to the constructor.
69
public
ReadOnlySequence
<byte> Sequence => this.reader.Sequence;
119
public MessagePackReader Clone(in
ReadOnlySequence
<byte> readOnlySequence) => new MessagePackReader(readOnlySequence)
268
public
ReadOnlySequence
<byte> ReadRaw(long length)
272
ReadOnlySequence
<byte> result = this.reader.Sequence.Slice(this.reader.Position, length);
289
public
ReadOnlySequence
<byte> ReadRaw()
669
public
ReadOnlySequence
<byte>? ReadBytes()
678
ReadOnlySequence
<byte> result = this.reader.Sequence.Slice(this.reader.Position, length);
694
public
ReadOnlySequence
<byte>? ReadStringSequence()
703
ReadOnlySequence
<byte> result = this.reader.Sequence.Slice(this.reader.Position, length);
913
ReadOnlySequence
<byte> data = this.reader.Sequence.Slice(this.reader.Position, header.Length);
1092
/// Reads a string assuming that it is spread across multiple spans in the <see cref="
ReadOnlySequence
{T}"/>.
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackWriter.cs (7)
104
public void WriteRaw(in
ReadOnlySequence
<byte> rawMessagePackBlock)
761
public void Write(in
ReadOnlySequence
<byte> src)
779
/// The caller should use <see cref="WriteRaw(in
ReadOnlySequence
{byte})"/> or <see cref="WriteRaw(ReadOnlySpan{byte})"/>
781
/// Alternatively a single call to <see cref="Write(ReadOnlySpan{byte})"/> or <see cref="Write(in
ReadOnlySequence
{byte})"/> will take care of the header and content in one call.
837
public void WriteString(in
ReadOnlySequence
<byte> utf8stringBytes)
872
/// The caller should use <see cref="WriteRaw(in
ReadOnlySequence
{byte})"/> or <see cref="WriteRaw(ReadOnlySpan{byte})"/>
874
/// Alternatively a single call to <see cref="WriteString(ReadOnlySpan{byte})"/> or <see cref="WriteString(in
ReadOnlySequence
{byte})"/> will take care of the header and content in one call.
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (5)
26
private
ReadOnlySequence
<T> sequence;
55
/// over the given <see cref="
ReadOnlySequence
{T}"/>.
58
public SequenceReader(in
ReadOnlySequence
<T> sequence)
106
/// Gets the underlying <see cref="
ReadOnlySequence
{T}"/> for the reader.
108
public
ReadOnlySequence
<T> Sequence
Microsoft.AspNetCore.Components.Web (1)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
153
var
sequence = new ReadOnlySequence<char>(this, startIndex, tail, tail.Memory.Length);
Microsoft.AspNetCore.Http.Connections (12)
Internal\Transports\LongPollingServerTransport.cs (1)
37
var
buffer = result.Buffer;
Internal\Transports\ServerSentEventsServerTransport.cs (1)
52
var
buffer = result.Buffer;
Internal\Transports\WebSocketsServerTransport.cs (1)
209
var
buffer = result.Buffer;
ServerSentEventsMessageFormatter.cs (5)
15
public static async Task WriteMessageAsync(
ReadOnlySequence
<byte> payload, Stream output, CancellationToken token)
46
private static ReadOnlyMemory<byte> GetLastSegment(in
ReadOnlySequence
<byte> source, out long offset)
66
private static async Task WriteMessageToMemory(Stream output,
ReadOnlySequence
<byte> payload)
73
ReadOnlySequence
<byte> lineSegment;
77
payload =
ReadOnlySequence
<byte>.Empty;
src\aspnetcore\src\SignalR\common\Shared\StreamExtensions.cs (2)
14
public static ValueTask WriteAsync(this Stream stream,
ReadOnlySequence
<byte> buffer, CancellationToken cancellationToken = default)
31
private static async ValueTask WriteMultiSegmentAsync(Stream stream,
ReadOnlySequence
<byte> buffer, CancellationToken cancellationToken)
src\aspnetcore\src\SignalR\common\Shared\WebSocketExtensions.cs (2)
14
public static ValueTask SendAsync(this WebSocket webSocket,
ReadOnlySequence
<byte> buffer, WebSocketMessageType webSocketMessageType, CancellationToken cancellationToken = default)
39
private static async ValueTask SendMultiSegmentAsync(WebSocket webSocket,
ReadOnlySequence
<byte> buffer, WebSocketMessageType webSocketMessageType, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.HttpLogging (2)
BufferingStream.cs (2)
64
var
ros = new ReadOnlySequence<byte>(_head, 0, _tail, _tailBytesBuffered);
89
EncodingExtensions.Convert(decoder,
ReadOnlySequence
<byte>.Empty, bufferWriter, flush: true, out charUsed, out completed);
Microsoft.AspNetCore.OutputCaching (12)
IOutputCacheBufferStore.cs (1)
32
ValueTask SetAsync(string key,
ReadOnlySequence
<byte> value, ReadOnlyMemory<string> tags, TimeSpan validFor, CancellationToken cancellationToken);
OutputCacheEntry.cs (2)
62
public
ReadOnlySequence
<byte> Body { get; private set; }
66
internal void SetBody(
ReadOnlySequence
<byte> value, bool recycleBuffers)
OutputCacheEntryFormatter.cs (1)
166
var
body = entry.Body;
OutputCacheMiddleware.cs (2)
311
var
body = context.CachedResponse.Body;
426
var
cachedResponseBody = context.OutputCacheStream.GetCachedResponseBody();
RecyclableReadOnlySequenceSegment.cs (3)
62
public static void RecycleChain(in
ReadOnlySequence
<byte> value, bool recycleBuffers = false)
79
internal static
ReadOnlySequence
<byte> CreateSequence(IList<byte[]> segments)
102
public static async ValueTask CopyToAsync(
ReadOnlySequence
<byte> source, PipeWriter destination, CancellationToken cancellationToken)
RecyclableSequenceBuilder.cs (2)
28
internal
ReadOnlySequence
<byte> DetachAndReset()
48
var
payload = new ReadOnlySequence<byte>(_firstSegment, 0, _currentSegment!, _currentSegmentIndex);
Streams\OutputCacheStream.cs (1)
45
internal
ReadOnlySequence
<byte> GetCachedResponseBody()
Microsoft.AspNetCore.Server.Kestrel.Core (109)
HttpsConnectionAdapterOptions.cs (3)
103
/// If you want to store the bytes from the <see cref="
ReadOnlySequence
{T}"/>,
104
/// copy them into a buffer that you control rather than keeping a reference to the <see cref="
ReadOnlySequence
{T}"/> or <see cref="ReadOnlyMemory{T}"/> instances.
111
public Action<ConnectionContext,
ReadOnlySequence
<byte>>? TlsClientHelloBytesCallback { get; set; }
Internal\Http\Http1ChunkedEncodingMessageBody.cs (10)
116
var
readableBuffer = result.Buffer;
205
private bool Read(
ReadOnlySequence
<byte> readableBuffer, PipeWriter writableBuffer, out SequencePosition consumed, out SequencePosition examined)
294
private void ParseChunkedPrefix(in
ReadOnlySequence
<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
360
private void ParseExtension(
ReadOnlySequence
<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
389
var
suffixBuffer = buffer.Slice(extensionCursor);
431
private void ReadChunkedData(in
ReadOnlySequence
<byte> buffer, PipeWriter writableBuffer, out SequencePosition consumed, out SequencePosition examined)
448
private void ParseChunkedSuffix(in
ReadOnlySequence
<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
458
var
suffixBuffer = buffer.Slice(0, 2);
476
private void ParseChunkedTrailer(in
ReadOnlySequence
<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
486
var
trailerBuffer = buffer.Slice(0, 2);
Internal\Http\Http1Connection.cs (10)
204
var
trimmedBuffer = reader.Sequence.Slice(reader.Position, ServerOptions.Limits.MaxRequestLineSize);
246
var
trimmedBuffer = reader.Sequence.Slice(reader.Position, _remainingRequestHeadersBytesAllowed);
334
var
trimmedBuffer = reader.Sequence.Slice(reader.Position, ServerOptions.Limits.MaxRequestLineSize);
372
var
trimmedBuffer = reader.Sequence.Slice(reader.Position, _remainingRequestHeadersBytesAllowed);
989
private void HandleBadRequest(
ReadOnlySequence
<byte> requestData, BadHttpRequestException ex)
998
private void HandleBadRequest(
ReadOnlySequence
<byte> requestData, RequestRejectionReason reason)
1009
private BadHttpRequestException CreateBadRequestException(HttpParseResult parseResult,
ReadOnlySequence
<byte> buffer)
1023
var
errorSlice = buffer.Slice(parseResult.ErrorOffset, parseResult.ErrorLength);
1034
private void OnBadRequest(
ReadOnlySequence
<byte> requestData, BadHttpRequestException ex)
1049
private void DetectHttp2Preface(
ReadOnlySequence
<byte> requestData)
Internal\Http\Http1ContentLengthMessageBody.cs (1)
216
var
buffer = _readResult.Buffer.Slice(consumed, _readResult.Buffer.End);
Internal\Http\HttpParser.cs (5)
117
var
currentSlice = reader.UnreadSequence;
175
ReadOnlySequence
<byte> header;
361
private void ThrowParseError(HttpParseResult result,
ReadOnlySequence
<byte> buffer)
375
var
errorSlice = buffer.Slice(result.ErrorOffset, result.ErrorLength);
551
reader.TryReadExact(requestLine.Length + 1, out
var
requestLineSequence);
Internal\Http\HttpRequestStream.cs (2)
125
var
buffer = result.Buffer;
135
var
slice = actual == length ? buffer : buffer.Slice(0, actual);
Internal\Http2\Http2Connection.cs (17)
325
var
buffer = result.Buffer;
339
while (Http2FrameReader.TryReadFrame(ref buffer, _incomingFrame, _serverSettings.MaxFrameSize, out
var
framePayload))
558
var
readableBuffer = result.Buffer;
637
private bool ParseHttp1x(
ReadOnlySequence
<byte> buffer, out HttpVersion httpVersion)
662
private static bool IsPreface(in
ReadOnlySequence
<byte> buffer, out SequencePosition consumed, out SequencePosition examined)
669
var
preface = buffer.Slice(0, ClientPreface.Length);
681
private Task ProcessFrameAsync<TContext>(IHttpApplication<TContext> application, in
ReadOnlySequence
<byte> payload) where TContext : notnull
708
private Task ProcessDataFrameAsync(in
ReadOnlySequence
<byte> payload)
790
private Task ProcessHeadersFrameAsync<TContext>(IHttpApplication<TContext> application, in
ReadOnlySequence
<byte> payload) where TContext : notnull
854
var
headersPayload = payload.Slice(0, _incomingFrame.HeadersPayloadLength); // Minus padding
887
var
headersPayload = payload.Slice(0, _incomingFrame.HeadersPayloadLength); // Minus padding
995
private Task ProcessSettingsFrameAsync(in
ReadOnlySequence
<byte> payload)
1079
private Task ProcessPingFrameAsync(in
ReadOnlySequence
<byte> payload)
1200
private Task ProcessContinuationFrameAsync(in
ReadOnlySequence
<byte> payload)
1244
private Task DecodeHeadersAsync(bool endHeaders, in
ReadOnlySequence
<byte> payload)
1271
private Task DecodeTrailersAsync(bool endHeaders, in
ReadOnlySequence
<byte> payload)
1908
var
bufferSlice = readResult.Buffer.Slice(0, copyAmount);
Internal\Http2\Http2FrameWriter.cs (8)
193
var
buffer = readResult.Buffer;
563
private ValueTask<FlushResult> WriteDataAndTrailersAsync(Http2Stream stream, in
ReadOnlySequence
<byte> data, bool writeHeaders, HttpResponseTrailers headers)
715
private void WriteDataUnsynchronized(int streamId, in
ReadOnlySequence
<byte> data, long dataLength, bool endStream)
742
void TrimAndWriteDataUnsynchronized(in
ReadOnlySequence
<byte> data, long dataLength, bool endStream)
750
var
remainingData = data;
753
var
currentData = remainingData.Slice(0, dataPayloadLength);
781
private ValueTask<FlushResult> WriteDataAsync(Http2Stream stream,
ReadOnlySequence
<byte> data, long dataLength, bool endStream, bool writeHeaders)
957
public ValueTask<FlushResult> WritePingAsync(Http2PingFrameFlags flags, in
ReadOnlySequence
<byte> payload)
Internal\Http2\Http2KeepAlive.cs (1)
24
internal static readonly
ReadOnlySequence
<byte> PingPayload = new ReadOnlySequence<byte>(new byte[8]);
Internal\Http2\Http2Stream.cs (2)
460
public Task OnDataAsync(Http2Frame dataFrame, in
ReadOnlySequence
<byte> payload)
469
var
dataPayload = payload.Slice(0, dataFrame.DataPayloadLength); // minus padding
Internal\Http3\Http3ControlStream.cs (9)
161
var
readableBuffer = result.Buffer;
264
var
readableBuffer = result.Buffer;
273
while (Http3FrameReader.TryReadFrame(ref readableBuffer, incomingFrame, isContinuedFrame, out
var
framePayload))
324
private ValueTask ProcessHttp3ControlStream(Http3RawFrame incomingFrame, bool isContinuedFrame, in
ReadOnlySequence
<byte> payload, out SequencePosition consumed)
360
private ValueTask ProcessSettingsFrameAsync(bool isContinuedFrame,
ReadOnlySequence
<byte> payload, out SequencePosition consumed)
422
private ValueTask ProcessGoAwayFrameAsync(bool isContinuedFrame, Http3RawFrame incomingFrame,
ReadOnlySequence
<byte> payload, out SequencePosition consumed)
444
private ValueTask ProcessCancelPushFrameAsync(Http3RawFrame incomingFrame,
ReadOnlySequence
<byte> payload, out SequencePosition consumed)
456
private ValueTask ProcessMaxPushIdFrameAsync(Http3RawFrame incomingFrame,
ReadOnlySequence
<byte> payload, out SequencePosition consumed)
479
private static void ParseVarIntWithFrameLengthValidation(Http3RawFrame incomingFrame,
ReadOnlySequence
<byte> payload, out SequencePosition consumed)
Internal\Http3\Http3FrameReader.cs (5)
24
internal static bool TryReadFrame(ref
ReadOnlySequence
<byte> readableBuffer, Http3RawFrame frame, bool isContinuedFrame, out
ReadOnlySequence
<byte> framePayload)
26
framePayload =
ReadOnlySequence
<byte>.Empty;
37
var
firstLengthBuffer = readableBuffer.Slice(consumed);
48
var
startOfFramePayload = readableBuffer.Slice(consumed);
Internal\Http3\Http3FrameWriter.cs (5)
160
public ValueTask<FlushResult> WriteDataAsync(in
ReadOnlySequence
<byte> data)
177
private void WriteDataUnsynchronized(in
ReadOnlySequence
<byte> data, long dataLength)
200
void SplitAndWriteDataUnsynchronized(in
ReadOnlySequence
<byte> data, long dataLength)
208
var
remainingData = data;
211
var
currentData = remainingData.Slice(0, dataPayloadLength);
Internal\Http3\Http3PendingStream.cs (1)
57
var
readableBuffer = result.Buffer;
Internal\Http3\Http3Stream.cs (5)
644
var
readableBuffer = result.Buffer;
652
while (Http3FrameReader.TryReadFrame(ref readableBuffer, incomingFrame, isContinuedFrame, out
var
framePayload))
788
in
ReadOnlySequence
<byte> payload, bool isCompleted) where TContext : notnull
816
ReadOnlySequence
<byte> payload, bool isCompleted) where TContext : notnull
927
private Task ProcessDataFrameAsync(in
ReadOnlySequence
<byte> payload)
Internal\Http3\QPack\DecoderStreamReader.cs (1)
53
public void Read(
ReadOnlySequence
<byte> data)
Internal\Http3\QPack\EncoderStreamReader.cs (1)
100
public void Read(
ReadOnlySequence
<byte> data)
ListenOptionsHttpsExtensions.cs (1)
304
public static ListenOptions UseTlsClientHelloListener(this ListenOptions listenOptions, Action<ConnectionContext,
ReadOnlySequence
<byte>> tlsClientHelloBytesCallback, TimeSpan? timeout = null)
Middleware\TlsListener.cs (6)
12
private readonly Action<ConnectionContext,
ReadOnlySequence
<byte>> _tlsClientHelloBytesCallback;
14
public TlsListener(Action<ConnectionContext,
ReadOnlySequence
<byte>> tlsClientHelloBytesCallback)
34
var
buffer = result.Buffer;
45
parseState = TryParseClientHello(buffer, ref recordLength, out
var
clientHelloBytes);
88
private static ClientHelloParseState TryParseClientHello(
ReadOnlySequence
<byte> buffer, ref short recordLength, out
ReadOnlySequence
<byte> clientHelloBytes)
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
126
public void Decode(in
ReadOnlySequence
<byte> data, bool endHeaders, IHttpStreamHeadersHandler handler)
src\aspnetcore\src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
132
public static bool TryGetInteger(in
ReadOnlySequence
<byte> buffer, out SequencePosition consumed, out long integer)
src\aspnetcore\src\Shared\runtime\Http3\QPack\QPackDecoder.cs (1)
166
public void Decode(in
ReadOnlySequence
<byte> data, bool endHeaders, IHttpStreamHeadersHandler handler)
src\aspnetcore\src\Shared\ServerInfrastructure\BufferExtensions.cs (6)
22
public static ReadOnlySpan<byte> ToSpan(in this
ReadOnlySequence
<byte> buffer)
32
public static void CopyTo(in this
ReadOnlySequence
<byte> buffer, PipeWriter pipeWriter)
44
private static void CopyToMultiSegment(in
ReadOnlySequence
<byte> buffer, PipeWriter pipeWriter)
67
/// Returns position of first occurrence of item in the <see cref="
ReadOnlySequence
{T}"/>
70
public static SequencePosition? PositionOfAny<T>(in this
ReadOnlySequence
<T> source, T value0, T value1) where T : IEquatable<T>
88
private static SequencePosition? PositionOfAnyMultiSegment<T>(in
ReadOnlySequence
<T> source, T value0, T value1) where T : IEquatable<T>
src\aspnetcore\src\Shared\ServerInfrastructure\DuplexPipeStream.cs (1)
122
var
readableBuffer = result.Buffer;
src\aspnetcore\src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (6)
39
public static bool TryReadFrame(ref
ReadOnlySequence
<byte> buffer, Http2Frame frame, uint maxFrameSize, out
ReadOnlySequence
<byte> framePayload)
41
framePayload =
ReadOnlySequence
<byte>.Empty;
48
var
headerSlice = buffer.Slice(0, HeaderLength);
78
private static int ReadExtendedFields(Http2Frame frame, in
ReadOnlySequence
<byte> readableBuffer)
226
public static IList<Http2PeerSetting> ReadSettings(in
ReadOnlySequence
<byte> payload)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
Internal\QuicStreamContext.cs (1)
397
var
buffer = result.Buffer;
Microsoft.AspNetCore.SignalR.Common (14)
Protocol\HandshakeProtocol.cs (4)
116
public static bool TryParseResponseMessage(ref
ReadOnlySequence
<byte> buffer, [NotNullWhen(true)] out HandshakeResponseMessage? responseMessage)
118
if (!TextMessageParser.TryParseMessage(ref buffer, out
var
payload))
170
public static bool TryParseRequestMessage(ref
ReadOnlySequence
<byte> buffer, [NotNullWhen(true)] out HandshakeRequestMessage? requestMessage)
172
if (!TextMessageParser.TryParseMessage(ref buffer, out
var
payload))
Protocol\IHubProtocol.cs (1)
38
bool TryParseMessage(ref
ReadOnlySequence
<byte> input, IInvocationBinder binder, [NotNullWhen(true)] out HubMessage? message);
Protocol\RawResult.cs (2)
27
public RawResult(
ReadOnlySequence
<byte> rawBytes)
36
public
ReadOnlySequence
<byte> RawSerializedData { get; private set; }
src\aspnetcore\src\SignalR\common\Shared\TextMessageParser.cs (4)
13
public static bool TryParseMessage(ref
ReadOnlySequence
<byte> buffer, out
ReadOnlySequence
<byte> payload)
37
private static bool TryParseMessageMultiSegment(ref
ReadOnlySequence
<byte> buffer, out
ReadOnlySequence
<byte> payload)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextReader.cs (3)
15
private
ReadOnlySequence
<byte> _utf8Buffer;
29
public static Utf8BufferTextReader Get(in
ReadOnlySequence
<byte> utf8Buffer)
59
public void SetBuffer(in
ReadOnlySequence
<byte> utf8Buffer)
Microsoft.AspNetCore.SignalR.Core (4)
HubConnectionContext.cs (2)
549
var
buffer = result.Buffer;
564
var
segment = buffer;
HubConnectionHandler.cs (2)
274
var
buffer = result.Buffer;
309
var
segment = buffer;
Microsoft.AspNetCore.SignalR.Protocols.Json (12)
Protocol\JsonHubProtocol.cs (5)
89
public bool TryParseMessage(ref
ReadOnlySequence
<byte> input, IInvocationBinder binder, [NotNullWhen(true)] out HubMessage? message)
91
if (!TextMessageParser.TryParseMessage(ref input, out
var
payload))
115
private HubMessage? ParseMessage(
ReadOnlySequence
<byte> input, IInvocationBinder binder)
814
private object? BindType(ref Utf8JsonReader reader,
ReadOnlySequence
<byte> input, Type type)
821
var
sequence = input.Slice(start, end - start);
src\aspnetcore\src\SignalR\common\Shared\TextMessageParser.cs (4)
13
public static bool TryParseMessage(ref
ReadOnlySequence
<byte> buffer, out
ReadOnlySequence
<byte> payload)
37
private static bool TryParseMessageMultiSegment(ref
ReadOnlySequence
<byte> buffer, out
ReadOnlySequence
<byte> payload)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextReader.cs (3)
15
private
ReadOnlySequence
<byte> _utf8Buffer;
29
public static Utf8BufferTextReader Get(in
ReadOnlySequence
<byte> utf8Buffer)
59
public void SetBuffer(in
ReadOnlySequence
<byte> utf8Buffer)
Microsoft.AspNetCore.WebUtilities (7)
FormPipeReader.cs (7)
98
var
buffer = readResult.Buffer;
132
ref
ReadOnlySequence
<byte> buffer,
235
ref
ReadOnlySequence
<byte> buffer,
240
ReadOnlySequence
<byte> keyValuePair;
276
ReadOnlySequence
<byte> value;
278
if (keyValueReader.TryReadTo(out
ReadOnlySequence
<byte> key, equalsDelimiter))
345
private string GetDecodedStringFromReadOnlySequence(in
ReadOnlySequence
<byte> ros)
Microsoft.Extensions.Caching.Abstractions (3)
Hybrid\IHybridCacheSerializer.cs (1)
17
T Deserialize(
ReadOnlySequence
<byte> source);
IBufferDistributedCache.cs (2)
41
void Set(string key,
ReadOnlySequence
<byte> value, DistributedCacheEntryOptions options);
51
ValueTask SetAsync(string key,
ReadOnlySequence
<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default);
Microsoft.Extensions.Caching.Hybrid (7)
Internal\BufferChunk.cs (1)
92
internal
ReadOnlySequence
<byte> AsSequence() => Length == 0 ? default : new ReadOnlySequence<byte>(OversizedArray!, Offset, Length);
Internal\DefaultJsonSerializerFactory.cs (1)
148
T IHybridCacheSerializer<T>.Deserialize(
ReadOnlySequence
<byte> source)
Internal\HybridCachePayload.cs (1)
102
string key, long creationTime, TimeSpan duration, PayloadFlags flags, TagSet tags,
ReadOnlySequence
<byte> payload)
Internal\InbuiltTypeSerializer.cs (3)
19
string IHybridCacheSerializer<string>.Deserialize(
ReadOnlySequence
<byte> source)
25
byte[] IHybridCacheSerializer<byte[]>.Deserialize(
ReadOnlySequence
<byte> source)
31
internal static string DeserializeString(
ReadOnlySequence
<byte> source)
Internal\RecyclableArrayBufferWriter.cs (1)
134
public
ReadOnlySequence
<T> AsSequence() => new(_buffer, 0, _index);
Microsoft.Extensions.Caching.Hybrid.Tests (14)
BufferReleaseTests.cs (2)
92
void IBufferDistributedCache.Set(string key,
ReadOnlySequence
<byte> value, DistributedCacheEntryOptions options)
95
ValueTask IBufferDistributedCache.SetAsync(string key,
ReadOnlySequence
<byte> value, DistributedCacheEntryOptions options, CancellationToken token)
DistributedCacheTests.cs (4)
182
var
payload = Invent(size, kind);
244
var
payload = Invent(size, kind);
277
private static
ReadOnlySequence
<byte> Invent(int size, SequenceKind kind)
280
ReadOnlySequence
<byte> payload;
L2Tests.cs (2)
165
void IBufferDistributedCache.Set(string key,
ReadOnlySequence
<byte> value, DistributedCacheEntryOptions options)
172
ValueTask IBufferDistributedCache.SetAsync(string key,
ReadOnlySequence
<byte> value, DistributedCacheEntryOptions options, CancellationToken token)
SerializerTests.cs (3)
303
private static
ReadOnlySequence
<byte> Split(
ReadOnlySequence
<byte> value)
316
var
result = new ReadOnlySequence<byte>(first, 0, second, chunk.Length - 1);
ServiceConstructionTests.cs (1)
671
Customer IHybridCacheSerializer<Customer>.Deserialize(
ReadOnlySequence
<byte> source) => throw new NotSupportedException();
SizeTests.cs (2)
288
public MutablePoco Deserialize(
ReadOnlySequence
<byte> source)
331
public ImmutablePoco Deserialize(
ReadOnlySequence
<byte> source)
mscorlib (1)
mscorlib.cs (1)
43
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.
ReadOnlySequence
<>))]
netstandard (1)
netstandard.cs (1)
70
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.
ReadOnlySequence
<>))]
System.IO.Pipelines (19)
System\IO\Pipelines\Pipe.cs (1)
973
var
readOnlySequence = new ReadOnlySequence<byte>(head, _readHeadIndex, _readTail, _readTailIndex);
System\IO\Pipelines\PipeReader.cs (5)
71
ReadOnlySequence
<byte> buffer = result.Buffer;
164
/// Creates a <see cref="PipeReader"/> wrapping the specified <see cref="
ReadOnlySequence
{T}"/>.
167
/// <returns>A <see cref="PipeReader"/> that wraps the <see cref="
ReadOnlySequence
{T}"/>.</returns>
168
public static PipeReader Create(
ReadOnlySequence
<byte> sequence)
237
ReadOnlySequence
<byte> buffer = result.Buffer;
System\IO\Pipelines\PipeReaderStream.cs (2)
118
ReadOnlySequence
<byte> sequence = result.Buffer;
128
ReadOnlySequence
<byte> slice = actual == bufferLength ? sequence : sequence.Slice(0, actual);
System\IO\Pipelines\ReadResult.cs (4)
11
internal readonly
ReadOnlySequence
<byte> _resultBuffer;
18
public ReadResult(
ReadOnlySequence
<byte> buffer, bool isCanceled, bool isCompleted)
33
/// <summary>Gets the <see cref="System.Buffers.
ReadOnlySequence
{T}" /> that was read.</summary>
35
public
ReadOnlySequence
<byte> Buffer => _resultBuffer;
System\IO\Pipelines\SequencePipeReader.cs (5)
12
private
ReadOnlySequence
<byte> _sequence;
17
public SequencePipeReader(
ReadOnlySequence
<byte> sequence)
36
_sequence =
ReadOnlySequence
<byte>.Empty;
58
_sequence =
ReadOnlySequence
<byte>.Empty;
69
result = new ReadResult(
ReadOnlySequence
<byte>.Empty, isCanceled: false, isCompleted: true);
System\IO\Pipelines\StreamPipeReader.cs (2)
472
ReadOnlySequence
<byte> buffer = GetCurrentReadOnlySequence();
482
private
ReadOnlySequence
<byte> GetCurrentReadOnlySequence()
System.Memory (112)
System\Buffers\BuffersExtensions.cs (10)
9
/// Extension methods for <see cref="
ReadOnlySequence
{T}"/>
14
/// Returns position of first occurrence of item in the <see cref="
ReadOnlySequence
{T}"/>
17
public static SequencePosition? PositionOf<T>(in this
ReadOnlySequence
<T> source, T value) where T : IEquatable<T>?
35
private static SequencePosition? PositionOfMultiSegment<T>(in
ReadOnlySequence
<T> source, T value) where T : IEquatable<T>?
58
/// Copy the <see cref="
ReadOnlySequence
{T}"/> to the specified <see cref="Span{Byte}"/>.
60
/// <param name="source">The source <see cref="
ReadOnlySequence
{T}"/>.</param>
63
public static void CopyTo<T>(in this
ReadOnlySequence
<T> source, Span<T> destination)
78
private static void CopyToMultiSegment<T>(in
ReadOnlySequence
<T> sequence, Span<T> destination)
100
/// Converts the <see cref="
ReadOnlySequence
{T}"/> to an array
102
public static T[] ToArray<T>(in this
ReadOnlySequence
<T> sequence)
System\Buffers\ReadOnlySequence.cs (43)
24
/// Returns empty <see cref="
ReadOnlySequence
{T}"/>
26
public static readonly
ReadOnlySequence
<T> Empty = new ReadOnlySequence<T>(Array.Empty<T>());
29
/// Length of the <see cref="
ReadOnlySequence
{T}"/>.
34
/// Determines if the <see cref="
ReadOnlySequence
{T}"/> is empty.
39
/// Determines if the <see cref="
ReadOnlySequence
{T}"/> contains a single <see cref="ReadOnlyMemory{T}"/> segment.
58
/// A position to the start of the <see cref="
ReadOnlySequence
{T}"/>.
67
/// A position to the end of the <see cref="
ReadOnlySequence
{T}"/>
91
/// Creates an instance of <see cref="
ReadOnlySequence
{T}"/> from linked memory list represented by start and end segments
111
/// Creates an instance of <see cref="
ReadOnlySequence
{T}"/> from the array.
125
/// Creates an instance of <see cref="
ReadOnlySequence
{T}"/> from the array, start, and index.
141
/// Creates an instance of <see cref="
ReadOnlySequence
{T}"/> from the <see cref="ReadOnlyMemory{T}"/>.
142
/// Consumer is expected to manage lifetime of memory until <see cref="
ReadOnlySequence
{T}"/> is not used anymore.
184
/// Forms a slice out of the current <see cref="
ReadOnlySequence
{T}"/>, beginning at <paramref name="start"/>, with <paramref name="length"/> items.
189
public
ReadOnlySequence
<T> Slice(long start, long length)
260
/// Forms a slice out of the current <see cref="
ReadOnlySequence
{T}"/>, beginning at <paramref name="start"/> and ending at <paramref name="end"/> (exclusive).
265
public
ReadOnlySequence
<T> Slice(long start, SequencePosition end)
339
/// Forms a slice out of the current <see cref="
ReadOnlySequence
{T}"/>, beginning at <paramref name="start"/>, with <paramref name="length"/> items.
344
public
ReadOnlySequence
<T> Slice(SequencePosition start, long length)
422
/// Forms a slice out of the current <see cref="
ReadOnlySequence
{T}"/>, beginning at <paramref name="start"/>, with <paramref name="length"/> items.
427
public
ReadOnlySequence
<T> Slice(int start, int length) => Slice((long)start, length);
430
/// Forms a slice out of the current <see cref="
ReadOnlySequence
{T}"/>, beginning at <paramref name="start"/> and ending at <paramref name="end"/> (exclusive).
435
public
ReadOnlySequence
<T> Slice(int start, SequencePosition end) => Slice((long)start, end);
438
/// Forms a slice out of the current <see cref="
ReadOnlySequence
{T}"/>, beginning at <paramref name="start"/>, with <paramref name="length"/> items.
443
public
ReadOnlySequence
<T> Slice(SequencePosition start, int length) => Slice(start, (long)length);
446
/// Forms a slice out of the given <see cref="
ReadOnlySequence
{T}"/>, beginning at <paramref name="start"/>, ending at <paramref name="end"/> (exclusive).
452
public
ReadOnlySequence
<T> Slice(SequencePosition start, SequencePosition end)
459
/// Forms a slice out of the current <see cref="
ReadOnlySequence
{T}" />, beginning at a specified sequence position and continuing to the end of the read-only sequence.
464
public
ReadOnlySequence
<T> Slice(SequencePosition start)
472
/// Forms a slice out of the current <see cref="
ReadOnlySequence
{T}" /> , beginning at a specified index and continuing to the end of the read-only sequence.
476
public
ReadOnlySequence
<T> Slice(long start)
493
ReadOnlySequence
<T> localThis = this;
494
ReadOnlySequence
<char> charSequence = Unsafe.As<
ReadOnlySequence
<T>,
ReadOnlySequence
<char>>(ref localThis);
511
/// Returns an enumerator over the <see cref="
ReadOnlySequence
{T}"/>
601
/// Returns <code>false</code> if end of <see cref="
ReadOnlySequence
{T}"/> was reached otherwise <code>true</code>.
616
/// An enumerator over the <see cref="
ReadOnlySequence
{T}"/>
620
private readonly
ReadOnlySequence
<T> _sequence;
625
/// <param name="sequence">The <see cref="
ReadOnlySequence
{T}"/> to enumerate.</param>
626
public Enumerator(in
ReadOnlySequence
<T> sequence)
639
/// Moves to the next <see cref="ReadOnlyMemory{T}"/> in the <see cref="
ReadOnlySequence
{T}"/>
665
/// Flag that allows encoding the <see cref="
ReadOnlySequence
{T}.SequenceType"/>.
667
/// <seealso cref="
ReadOnlySequence
{T}.GetSequenceType"/>
System\Buffers\ReadOnlySequence.Helpers.cs (2)
467
private
ReadOnlySequence
<T> SliceImpl(in SequencePosition start, in SequencePosition end)
482
private
ReadOnlySequence
<T> SliceImpl(in SequencePosition start)
System\Buffers\ReadOnlySequenceDebugView.cs (1)
14
public ReadOnlySequenceDebugView(
ReadOnlySequence
<T> sequence)
System\Buffers\SequenceReader.cs (5)
17
/// Create a <see cref="SequenceReader{T}"/> over the given <see cref="
ReadOnlySequence
{T}"/>.
20
public SequenceReader(
ReadOnlySequence
<T> sequence)
45
/// The underlying <see cref="
ReadOnlySequence
{T}"/> for the reader.
47
public
ReadOnlySequence
<T> Sequence { get; }
55
public readonly
ReadOnlySequence
<T> UnreadSequence => Sequence.Slice(Position);
System\Buffers\SequenceReader.Search.cs (12)
35
if (!TryReadToInternal(out
ReadOnlySequence
<T> sequence, delimiter, advancePastDelimiter, CurrentSpan.Length - CurrentSpanIndex))
72
if (!TryReadToSlow(out
ReadOnlySequence
<T> sequence, delimiter, delimiterEscape, index, advancePastDelimiter))
83
private bool TryReadToSlow(out
ReadOnlySequence
<T> sequence, T delimiter, T delimiterEscape, int index, bool advancePastDelimiter)
188
public bool TryReadTo(out
ReadOnlySequence
<T> sequence, T delimiter, bool advancePastDelimiter = true)
193
private bool TryReadToInternal(out
ReadOnlySequence
<T> sequence, T delimiter, bool advancePastDelimiter, int skip = 0)
239
public bool TryReadTo(out
ReadOnlySequence
<T> sequence, T delimiter, T delimiterEscape, bool advancePastDelimiter = true)
347
if (!TryReadToAnyInternal(out
ReadOnlySequence
<T> sequence, delimiters, advancePastDelimiter, CurrentSpan.Length - CurrentSpanIndex))
364
public bool TryReadToAny(out
ReadOnlySequence
<T> sequence, scoped ReadOnlySpan<T> delimiters, bool advancePastDelimiter = true)
369
private bool TryReadToAnyInternal(out
ReadOnlySequence
<T> sequence, scoped ReadOnlySpan<T> delimiters, bool advancePastDelimiter, int skip = 0)
433
if (!TryReadTo(out
ReadOnlySequence
<T> sequence, delimiter, advancePastDelimiter))
451
public bool TryReadTo(out
ReadOnlySequence
<T> sequence, scoped ReadOnlySpan<T> delimiter, bool advancePastDelimiter = true)
511
public bool TryReadExact(int count, out
ReadOnlySequence
<T> sequence)
System\Runtime\InteropServices\SequenceMarshal.cs (9)
10
/// Provides a collection of methods for interoperating with <see cref="
ReadOnlySequence
{T}"/>
15
/// Get <see cref="ReadOnlySequenceSegment{T}"/> from the underlying <see cref="
ReadOnlySequence
{T}"/>.
18
public static bool TryGetReadOnlySequenceSegment<T>(
ReadOnlySequence
<T> sequence,
28
/// Get an array segment from the underlying <see cref="
ReadOnlySequence
{T}"/>.
31
public static bool TryGetArray<T>(
ReadOnlySequence
<T> sequence, out ArraySegment<T> segment)
37
/// Get <see cref="ReadOnlyMemory{T}"/> from the underlying <see cref="
ReadOnlySequence
{T}"/>.
40
public static bool TryGetReadOnlyMemory<T>(
ReadOnlySequence
<T> sequence, out ReadOnlyMemory<T> memory)
53
/// Get <see cref="string"/> from the underlying <see cref="
ReadOnlySequence
{T}"/>.
56
internal static bool TryGetString(
ReadOnlySequence
<char> sequence, [NotNullWhen(true)] out string? text, out int start, out int length)
System\SequencePosition.cs (2)
41
/// <see cref="SequencePosition"/> equality does not guarantee that they point to the same location in <see cref="System.Buffers.
ReadOnlySequence
{T}" />
47
/// <see cref="SequencePosition"/> equality does not guarantee that they point to the same location in <see cref="System.Buffers.
ReadOnlySequence
{T}" />
System\Text\EncodingExtensions.cs (28)
61
/// Decodes the specified <see cref="
ReadOnlySequence
{Char}"/> to <see langword="byte"/>s using the specified <see cref="Encoding"/>
65
/// <param name="chars">The <see cref="
ReadOnlySequence
{Char}"/> whose contents should be encoded.</param>
70
public static long GetBytes(this Encoding encoding, in
ReadOnlySequence
<char> chars, IBufferWriter<byte> writer)
90
/// Encodes the specified <see cref="
ReadOnlySequence
{Char}"/> to <see langword="byte"/>s using the specified <see cref="Encoding"/>
94
/// <param name="chars">The <see cref="
ReadOnlySequence
{Char}"/> to encode to <see langword="byte"/>s.</param>
100
public static int GetBytes(this Encoding encoding, in
ReadOnlySequence
<char> chars, Span<byte> bytes)
115
ReadOnlySequence
<char> remainingChars = chars;
135
/// Encodes the specified <see cref="
ReadOnlySequence
{Char}"/> into a <see cref="byte"/> array using the specified <see cref="Encoding"/>.
138
/// <param name="chars">The <see cref="
ReadOnlySequence
{Char}"/> to encode to <see langword="byte"/>s.</param>
142
public static byte[] GetBytes(this Encoding encoding, in
ReadOnlySequence
<char> chars)
169
ReadOnlySequence
<char> remainingChars = chars;
252
/// Decodes the specified <see cref="
ReadOnlySequence
{Byte}"/> to <see langword="char"/>s using the specified <see cref="Encoding"/>
256
/// <param name="bytes">The <see cref="
ReadOnlySequence
{Byte}"/> whose bytes should be decoded.</param>
261
public static long GetChars(this Encoding encoding, in
ReadOnlySequence
<byte> bytes, IBufferWriter<char> writer)
281
/// Decodes the specified <see cref="
ReadOnlySequence
{Byte}"/> to <see langword="char"/>s using the specified <see cref="Encoding"/>
285
/// <param name="bytes">The <see cref="
ReadOnlySequence
{Byte}"/> to decode to characters.</param>
291
public static int GetChars(this Encoding encoding, in
ReadOnlySequence
<byte> bytes, Span<char> chars)
306
ReadOnlySequence
<byte> remainingBytes = bytes;
326
/// Decodes the specified <see cref="
ReadOnlySequence
{Byte}"/> into a <see cref="string"/> using the specified <see cref="Encoding"/>.
329
/// <param name="bytes">The <see cref="
ReadOnlySequence
{Byte}"/> to decode into characters.</param>
333
public static string GetString(this Encoding encoding, in
ReadOnlySequence
<byte> bytes)
356
ReadOnlySequence
<byte> remainingBytes = bytes;
449
/// Converts a <see cref="
ReadOnlySequence
{Char}"/> to encoded bytes and writes the result to <paramref name="writer"/>.
461
public static void Convert(this Encoder encoder, in
ReadOnlySequence
<char> chars, IBufferWriter<byte> writer, bool flush, out long bytesUsed, out bool completed)
471
ReadOnlySequence
<char> remainingChars = chars;
542
/// Converts a <see cref="
ReadOnlySequence
{Byte}"/> to UTF-16 encoded characters and writes the result to <paramref name="writer"/>.
555
public static void Convert(this Decoder decoder, in
ReadOnlySequence
<byte> bytes, IBufferWriter<char> writer, bool flush, out long charsUsed, out bool completed)
565
ReadOnlySequence
<byte> remainingBytes = bytes;
System.Net.Http (3)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (1)
126
public void Decode(in
ReadOnlySequence
<byte> data, bool endHeaders, IHttpStreamHeadersHandler handler)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
132
public static bool TryGetInteger(in
ReadOnlySequence
<byte> buffer, out SequencePosition consumed, out long integer)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (1)
166
public void Decode(in
ReadOnlySequence
<byte> data, bool endHeaders, IHttpStreamHeadersHandler handler)
System.Text.Json (33)
System\Text\Json\Document\JsonDocument.Parse.cs (5)
57
/// The <see cref="
ReadOnlySequence
{T}"/> may be used for the entire lifetime of the
77
public static JsonDocument Parse(
ReadOnlySequence
<byte> utf8Json, JsonDocumentOptions options = default)
460
ReadOnlySequence
<byte> valueSequence = default;
515
ReadOnlySequence
<byte> sequence = reader.OriginalSequence;
572
ReadOnlySequence
<byte> sequence = reader.OriginalSequence;
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (1)
121
public static unsafe bool UnescapeAndCompare(
ReadOnlySequence
<byte> utf8Source, ReadOnlySpan<byte> other)
System\Text\Json\Reader\Utf8JsonReader.cs (6)
47
private readonly
ReadOnlySequence
<byte> _sequence;
51
internal readonly
ReadOnlySequence
<byte> OriginalSequence => _sequence;
160
public
ReadOnlySequence
<byte> ValueSequence { get; private set; }
247
ValueSequence =
ReadOnlySequence
<byte>.Empty;
583
ReadOnlySequence
<byte> localSequence = ValueSequence;
636
ReadOnlySequence
<byte> localSequence = ValueSequence;
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (4)
24
public Utf8JsonReader(
ReadOnlySequence
<byte> jsonData, bool isFinalBlock, JsonReaderState state)
54
ValueSequence =
ReadOnlySequence
<byte>.Empty;
115
public Utf8JsonReader(
ReadOnlySequence
<byte> jsonData, JsonReaderOptions options = default)
2201
ReadOnlySequence
<byte> commentSequence = _sequence.Slice(start, end);
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (3)
98
ReadOnlySequence
<byte> valueSequence = ValueSequence;
168
ReadOnlySequence
<byte> valueSequence = ValueSequence;
205
ReadOnlySequence
<byte> valueSequence = ValueSequence;
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (1)
57
ReadOnlySequence
<byte> originalSequence = reader.OriginalSequence;
System\Text\Json\Serialization\IReadBufferState.cs (1)
17
public abstract
ReadOnlySequence
<byte> Bytes { get; }
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (3)
326
ReadOnlySequence
<byte> valueSequence = default;
371
ReadOnlySequence
<byte> sequence = reader.OriginalSequence;
410
ReadOnlySequence
<byte> originalSequence = reader.OriginalSequence;
System\Text\Json\Serialization\PipeReadBufferState.cs (7)
18
private
ReadOnlySequence
<byte> _sequence =
ReadOnlySequence
<byte>.Empty;
31
public readonly
ReadOnlySequence
<byte> Bytes => _sequence;
45
_sequence =
ReadOnlySequence
<byte>.Empty;
55
Debug.Assert(_sequence.Equals(
ReadOnlySequence
<byte>.Empty), "ReadAsync should only be called when the buffer is empty.");
141
if (_sequence.Equals(
ReadOnlySequence
<byte>.Empty))
150
_sequence =
ReadOnlySequence
<byte>.Empty;
System\Text\Json\Serialization\StreamReadBufferState.cs (1)
55
public readonly
ReadOnlySequence
<byte> Bytes => new(_buffer.AsMemory(_offset, _count));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (1)
134
public void WriteRawValue(
ReadOnlySequence
<byte> utf8Json, bool skipInputValidation = false)