124 instantiations of Memory
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.Server.IIS (3)
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Microsoft.AspNetCore.WebUtilities (2)
Microsoft.Data.Analysis (1)
Microsoft.Data.Analysis.Tests (1)
Microsoft.Extensions.Logging.Console (2)
Microsoft.ML.Tokenizers (2)
Shared (2)
System.Collections.Immutable (1)
System.Diagnostics.Process (1)
System.Formats.Tar (2)
System.IO.Compression (6)
System.IO.Compression.Brotli (3)
System.IO.Pipelines (1)
System.IO.Pipes (1)
System.IO.Ports (1)
System.Memory (1)
System.Net.Http (5)
System.Net.Http.Json (1)
System.Net.Primitives (1)
System.Net.Quic (5)
System.Net.Requests (1)
System.Net.Security (7)
System\Net\Security\NegotiateStream.cs (3)
306ValueTask<int> vt = ReadAsync<SyncReadWriteAdapter>(new Memory<byte>(buffer, offset, count), default(CancellationToken));
321return ReadAsync<AsyncReadWriteAdapter>(new Memory<byte>(buffer, offset, count), cancellationToken).AsTask();
389readBytes = await ReadAllAsync(InnerStream, new Memory<byte>(_readBuffer, 0, readBytes), allowZeroRead: false, cancellationToken).ConfigureAwait(false);
System.Net.ServerSentEvents (2)
System.Net.Sockets (5)
System\Net\Sockets\SocketPal.Unix.cs (3)
1284return handle.AsyncContext.Receive(new Memory<byte>(buffer, offset, count), socketFlags, handle.ReceiveTimeout, out bytesTransferred);
1314errorCode = handle.AsyncContext.ReceiveMessageFrom(new Memory<byte>(buffer, offset, count), ref socketFlags, socketAddress.Buffer, out socketAddressLen, isIPv4, isIPv6, handle.ReceiveTimeout, out ipPacketInformation, out bytesTransferred);
1359return handle.AsyncContext.ReceiveFrom(new Memory<byte>(buffer, offset, count), ref socketFlags, socketAddress, out socketAddressLen, handle.ReceiveTimeout, out bytesTransferred);
System.Net.WebClient (2)
System.Net.WebSockets (1)
System.Net.WebSockets.Client (1)
System.Private.CoreLib (32)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (5)
1100return ReadAsyncInternalWithGuard(new Memory<char>(buffer, index, count), CancellationToken.None);
1103Task<int> task = ReadAsyncInternal(new Memory<char>(buffer, index, count), CancellationToken.None).AsTask();
1178int len = await tmpStream.ReadAsync(new Memory<byte>(tmpByteBuffer, tmpBytePos, tmpByteBuffer.Length - tmpBytePos), cancellationToken).ConfigureAwait(false);
1214_byteLen = await tmpStream.ReadAsync(new Memory<byte>(tmpByteBuffer), cancellationToken).ConfigureAwait(false);
1408_byteLen = await tmpStream.ReadAsync(new Memory<byte>(tmpByteBuffer), cancellationToken).ConfigureAwait(false);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (8)
3830public static Memory<T> AsMemory<T>(this T[]? array) => new Memory<T>(array);
3843public static Memory<T> AsMemory<T>(this T[]? array, int start) => new Memory<T>(array, start);
3860return new Memory<T>(array, actualIndex);
3875public static Memory<T> AsMemory<T>(this T[]? array, int start, int length) => new Memory<T>(array, start, length);
3894return new Memory<T>(array, start, length);
3900public static Memory<T> AsMemory<T>(this ArraySegment<T> segment) => new Memory<T>(segment.Array, segment.Offset, segment.Count);
3918return new Memory<T>(segment.Array, segment.Offset + start, segment.Count - start);
3940return new Memory<T>(segment.Array, segment.Offset + start, length);
System.Security.Cryptography (2)
System.ServiceModel.NetFramingBase (20)
System\ServiceModel\Channels\Connection.cs (8)
193return Connection.WriteAsync(new Memory<byte>(buffer, offset, count), Immediate, TimeoutHelper.FromMilliseconds(WriteTimeout)).AsTask();
198Connection.WriteAsync(new Memory<byte>(buffer, offset, count), Immediate, TimeoutHelper.FromMilliseconds(WriteTimeout)).GetAwaiter().GetResult();
204Memory<byte> memBuffer = new Memory<byte>(sharedBuffer, 0, buffer.Length);
223return Connection.WriteAsync(new Memory<byte>(buffer, offset, count), Immediate, TimeoutHelper.FromMilliseconds(WriteTimeout))
232return Connection.ReadAsync(new Memory<byte>(buffer, offset, count), TimeoutHelper.FromMilliseconds(ReadTimeout)).AsTask();
243Memory<byte> memBuffer = new Memory<byte>(sharedBuffer, 0, buffer.Length);
260return Connection.ReadAsync(new Memory<byte>(buffer, offset, count), TimeoutHelper.FromMilliseconds(ReadTimeout)).GetAwaiter().GetResult();
265return Connection.ReadAsync(new Memory<byte>(buffer, offset, count), timeout).GetAwaiter().GetResult();
System\ServiceModel\Channels\SingletonConnectionReader.cs (6)
155size = await Connection.ReadAsync(new Memory<byte>(buffer, 0, Connection.ConnectionBufferSize), timeoutHelper.RemainingTime());
484int bytesRead = await ReadCoreAsync(new Memory<byte>(buffer, offset, bytesToRead));
518int bytesRead = await ReadCoreAsync(new Memory<byte>(buffer, offset, IntEncoder.MaxEncodedSize));
593envelopeStartBytes.CopyTo(new Memory<byte>(messageData.Array, messageData.Offset - envelopeStartBytes.Length, envelopeStartBytes.Length));
594await connection.WriteAsync(new Memory<byte>(messageData.Array, messageData.Offset - envelopeStartBytes.Length,
659WriteAsync(new Memory<byte>(buffer, offset, count)).GetAwaiter().GetResult();
System.ServiceModel.Primitives (2)
System.Text.Json (2)
1205 references to Memory
Aspire.Dashboard (2)
Aspire.Hosting.Browsers.Tests (1)
Aspire.Hosting.Tests (1)
dotnet (2)
GenerateDocumentationAndConfigFiles (36)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (36)
27foreach (var memory in array.GetSegments(index, length))
67foreach (var memory in sourceArray.GetSegments(0, length))
162foreach (var memory in sourceArray.GetSegments(sourceIndex, length))
229foreach (var memory in array.GetSegments(startIndex, count))
462private (Memory<T> first, Memory<T> second) _current;
473_current = (Memory<T>.Empty, Memory<T>.Empty);
476public readonly (Memory<T> first, Memory<T> second) Current => _current;
482_current = (Memory<T>.Empty, Memory<T>.Empty);
567private (Memory<T> first, Memory<T> second) _current;
578_current = (Memory<T>.Empty, Memory<T>.Empty);
581public readonly (Memory<T> first, Memory<T> second) Current => _current;
587_current = (Memory<T>.Empty, Memory<T>.Empty);
615private (Memory<T> first, Memory<T> second) _current;
626_current = (Memory<T>.Empty, Memory<T>.Empty);
629public readonly (Memory<T> first, Memory<T> second) Current => _current;
635_current = (Memory<T>.Empty, Memory<T>.Empty);
709private Memory<T> _current;
718_current = Memory<T>.Empty;
721public readonly Memory<T> Current => _current;
727_current = Memory<T>.Empty;
758private Memory<T> _current;
767_current = Memory<T>.Empty;
770public readonly Memory<T> Current => _current;
776_current = Memory<T>.Empty;
Microsoft.AspNetCore.Antiforgery (1)
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Components.Endpoints (6)
Microsoft.AspNetCore.Components.Server (12)
Microsoft.AspNetCore.Components.Web (2)
Microsoft.AspNetCore.Components.WebAssembly (2)
Microsoft.AspNetCore.Components.WebView (2)
Microsoft.AspNetCore.DataProtection (2)
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (2)
Microsoft.AspNetCore.Diagnostics.Middleware (4)
Microsoft.AspNetCore.Http (1)
Microsoft.AspNetCore.Http.Connections (3)
Microsoft.AspNetCore.Http.Connections.Client (2)
Microsoft.AspNetCore.Http.Connections.Common (2)
Microsoft.AspNetCore.Http.Extensions (7)
Microsoft.AspNetCore.HttpLogging (6)
Microsoft.AspNetCore.Mvc.Core (1)
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Microsoft.AspNetCore.OpenApi (3)
Microsoft.AspNetCore.OutputCaching (1)
Microsoft.AspNetCore.Razor.Utilities.Shared (9)
Microsoft.AspNetCore.RequestDecompression (1)
Microsoft.AspNetCore.Server.HttpSys (6)
Microsoft.AspNetCore.Server.IIS (23)
Microsoft.AspNetCore.Server.Kestrel.Core (42)
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (3)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (5)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (6)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (4)
Microsoft.AspNetCore.SignalR.Common (3)
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (3)
Microsoft.AspNetCore.SignalR.Specification.Tests (1)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (1)
Microsoft.AspNetCore.TestHost (3)
Microsoft.AspNetCore.Watch.BrowserRefresh (2)
Microsoft.AspNetCore.WebSockets (1)
Microsoft.AspNetCore.WebUtilities (9)
Microsoft.Build (38)
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedArray.cs (36)
27foreach (var memory in array.GetSegments(index, length))
67foreach (var memory in sourceArray.GetSegments(0, length))
162foreach (var memory in sourceArray.GetSegments(sourceIndex, length))
229foreach (var memory in array.GetSegments(startIndex, count))
462private (Memory<T> first, Memory<T> second) _current;
473_current = (Memory<T>.Empty, Memory<T>.Empty);
476public readonly (Memory<T> first, Memory<T> second) Current => _current;
482_current = (Memory<T>.Empty, Memory<T>.Empty);
567private (Memory<T> first, Memory<T> second) _current;
578_current = (Memory<T>.Empty, Memory<T>.Empty);
581public readonly (Memory<T> first, Memory<T> second) Current => _current;
587_current = (Memory<T>.Empty, Memory<T>.Empty);
615private (Memory<T> first, Memory<T> second) _current;
626_current = (Memory<T>.Empty, Memory<T>.Empty);
629public readonly (Memory<T> first, Memory<T> second) Current => _current;
635_current = (Memory<T>.Empty, Memory<T>.Empty);
709private Memory<T> _current;
718_current = Memory<T>.Empty;
721public readonly Memory<T> Current => _current;
727_current = Memory<T>.Empty;
758private Memory<T> _current;
767_current = Memory<T>.Empty;
770public readonly Memory<T> Current => _current;
776_current = Memory<T>.Empty;
Microsoft.CodeAnalysis (36)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (36)
27foreach (var memory in array.GetSegments(index, length))
67foreach (var memory in sourceArray.GetSegments(0, length))
162foreach (var memory in sourceArray.GetSegments(sourceIndex, length))
229foreach (var memory in array.GetSegments(startIndex, count))
462private (Memory<T> first, Memory<T> second) _current;
473_current = (Memory<T>.Empty, Memory<T>.Empty);
476public readonly (Memory<T> first, Memory<T> second) Current => _current;
482_current = (Memory<T>.Empty, Memory<T>.Empty);
567private (Memory<T> first, Memory<T> second) _current;
578_current = (Memory<T>.Empty, Memory<T>.Empty);
581public readonly (Memory<T> first, Memory<T> second) Current => _current;
587_current = (Memory<T>.Empty, Memory<T>.Empty);
615private (Memory<T> first, Memory<T> second) _current;
626_current = (Memory<T>.Empty, Memory<T>.Empty);
629public readonly (Memory<T> first, Memory<T> second) Current => _current;
635_current = (Memory<T>.Empty, Memory<T>.Empty);
709private Memory<T> _current;
718_current = Memory<T>.Empty;
721public readonly Memory<T> Current => _current;
727_current = Memory<T>.Empty;
758private Memory<T> _current;
767_current = Memory<T>.Empty;
770public readonly Memory<T> Current => _current;
776_current = Memory<T>.Empty;
Microsoft.CodeAnalysis.Analyzers (36)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (36)
27foreach (var memory in array.GetSegments(index, length))
67foreach (var memory in sourceArray.GetSegments(0, length))
162foreach (var memory in sourceArray.GetSegments(sourceIndex, length))
229foreach (var memory in array.GetSegments(startIndex, count))
462private (Memory<T> first, Memory<T> second) _current;
473_current = (Memory<T>.Empty, Memory<T>.Empty);
476public readonly (Memory<T> first, Memory<T> second) Current => _current;
482_current = (Memory<T>.Empty, Memory<T>.Empty);
567private (Memory<T> first, Memory<T> second) _current;
578_current = (Memory<T>.Empty, Memory<T>.Empty);
581public readonly (Memory<T> first, Memory<T> second) Current => _current;
587_current = (Memory<T>.Empty, Memory<T>.Empty);
615private (Memory<T> first, Memory<T> second) _current;
626_current = (Memory<T>.Empty, Memory<T>.Empty);
629public readonly (Memory<T> first, Memory<T> second) Current => _current;
635_current = (Memory<T>.Empty, Memory<T>.Empty);
709private Memory<T> _current;
718_current = Memory<T>.Empty;
721public readonly Memory<T> Current => _current;
727_current = Memory<T>.Empty;
758private Memory<T> _current;
767_current = Memory<T>.Empty;
770public readonly Memory<T> Current => _current;
776_current = Memory<T>.Empty;
Microsoft.CodeAnalysis.AnalyzerUtilities (36)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (36)
27foreach (var memory in array.GetSegments(index, length))
67foreach (var memory in sourceArray.GetSegments(0, length))
162foreach (var memory in sourceArray.GetSegments(sourceIndex, length))
229foreach (var memory in array.GetSegments(startIndex, count))
462private (Memory<T> first, Memory<T> second) _current;
473_current = (Memory<T>.Empty, Memory<T>.Empty);
476public readonly (Memory<T> first, Memory<T> second) Current => _current;
482_current = (Memory<T>.Empty, Memory<T>.Empty);
567private (Memory<T> first, Memory<T> second) _current;
578_current = (Memory<T>.Empty, Memory<T>.Empty);
581public readonly (Memory<T> first, Memory<T> second) Current => _current;
587_current = (Memory<T>.Empty, Memory<T>.Empty);
615private (Memory<T> first, Memory<T> second) _current;
626_current = (Memory<T>.Empty, Memory<T>.Empty);
629public readonly (Memory<T> first, Memory<T> second) Current => _current;
635_current = (Memory<T>.Empty, Memory<T>.Empty);
709private Memory<T> _current;
718_current = Memory<T>.Empty;
721public readonly Memory<T> Current => _current;
727_current = Memory<T>.Empty;
758private Memory<T> _current;
767_current = Memory<T>.Empty;
770public readonly Memory<T> Current => _current;
776_current = Memory<T>.Empty;
Microsoft.CodeAnalysis.CodeStyle (36)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (36)
27foreach (var memory in array.GetSegments(index, length))
67foreach (var memory in sourceArray.GetSegments(0, length))
162foreach (var memory in sourceArray.GetSegments(sourceIndex, length))
229foreach (var memory in array.GetSegments(startIndex, count))
462private (Memory<T> first, Memory<T> second) _current;
473_current = (Memory<T>.Empty, Memory<T>.Empty);
476public readonly (Memory<T> first, Memory<T> second) Current => _current;
482_current = (Memory<T>.Empty, Memory<T>.Empty);
567private (Memory<T> first, Memory<T> second) _current;
578_current = (Memory<T>.Empty, Memory<T>.Empty);
581public readonly (Memory<T> first, Memory<T> second) Current => _current;
587_current = (Memory<T>.Empty, Memory<T>.Empty);
615private (Memory<T> first, Memory<T> second) _current;
626_current = (Memory<T>.Empty, Memory<T>.Empty);
629public readonly (Memory<T> first, Memory<T> second) Current => _current;
635_current = (Memory<T>.Empty, Memory<T>.Empty);
709private Memory<T> _current;
718_current = Memory<T>.Empty;
721public readonly Memory<T> Current => _current;
727_current = Memory<T>.Empty;
758private Memory<T> _current;
767_current = Memory<T>.Empty;
770public readonly Memory<T> Current => _current;
776_current = Memory<T>.Empty;
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.Extensions.Package (36)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (36)
27foreach (var memory in array.GetSegments(index, length))
67foreach (var memory in sourceArray.GetSegments(0, length))
162foreach (var memory in sourceArray.GetSegments(sourceIndex, length))
229foreach (var memory in array.GetSegments(startIndex, count))
462private (Memory<T> first, Memory<T> second) _current;
473_current = (Memory<T>.Empty, Memory<T>.Empty);
476public readonly (Memory<T> first, Memory<T> second) Current => _current;
482_current = (Memory<T>.Empty, Memory<T>.Empty);
567private (Memory<T> first, Memory<T> second) _current;
578_current = (Memory<T>.Empty, Memory<T>.Empty);
581public readonly (Memory<T> first, Memory<T> second) Current => _current;
587_current = (Memory<T>.Empty, Memory<T>.Empty);
615private (Memory<T> first, Memory<T> second) _current;
626_current = (Memory<T>.Empty, Memory<T>.Empty);
629public readonly (Memory<T> first, Memory<T> second) Current => _current;
635_current = (Memory<T>.Empty, Memory<T>.Empty);
709private Memory<T> _current;
718_current = Memory<T>.Empty;
721public readonly Memory<T> Current => _current;
727_current = Memory<T>.Empty;
758private Memory<T> _current;
767_current = Memory<T>.Empty;
770public readonly Memory<T> Current => _current;
776_current = Memory<T>.Empty;
Microsoft.CodeAnalysis.ResxSourceGenerator (36)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (36)
27foreach (var memory in array.GetSegments(index, length))
67foreach (var memory in sourceArray.GetSegments(0, length))
162foreach (var memory in sourceArray.GetSegments(sourceIndex, length))
229foreach (var memory in array.GetSegments(startIndex, count))
462private (Memory<T> first, Memory<T> second) _current;
473_current = (Memory<T>.Empty, Memory<T>.Empty);
476public readonly (Memory<T> first, Memory<T> second) Current => _current;
482_current = (Memory<T>.Empty, Memory<T>.Empty);
567private (Memory<T> first, Memory<T> second) _current;
578_current = (Memory<T>.Empty, Memory<T>.Empty);
581public readonly (Memory<T> first, Memory<T> second) Current => _current;
587_current = (Memory<T>.Empty, Memory<T>.Empty);
615private (Memory<T> first, Memory<T> second) _current;
626_current = (Memory<T>.Empty, Memory<T>.Empty);
629public readonly (Memory<T> first, Memory<T> second) Current => _current;
635_current = (Memory<T>.Empty, Memory<T>.Empty);
709private Memory<T> _current;
718_current = Memory<T>.Empty;
721public readonly Memory<T> Current => _current;
727_current = Memory<T>.Empty;
758private Memory<T> _current;
767_current = Memory<T>.Empty;
770public readonly Memory<T> Current => _current;
776_current = Memory<T>.Empty;
Microsoft.CodeAnalysis.Workspaces (36)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (36)
27foreach (var memory in array.GetSegments(index, length))
67foreach (var memory in sourceArray.GetSegments(0, length))
162foreach (var memory in sourceArray.GetSegments(sourceIndex, length))
229foreach (var memory in array.GetSegments(startIndex, count))
462private (Memory<T> first, Memory<T> second) _current;
473_current = (Memory<T>.Empty, Memory<T>.Empty);
476public readonly (Memory<T> first, Memory<T> second) Current => _current;
482_current = (Memory<T>.Empty, Memory<T>.Empty);
567private (Memory<T> first, Memory<T> second) _current;
578_current = (Memory<T>.Empty, Memory<T>.Empty);
581public readonly (Memory<T> first, Memory<T> second) Current => _current;
587_current = (Memory<T>.Empty, Memory<T>.Empty);
615private (Memory<T> first, Memory<T> second) _current;
626_current = (Memory<T>.Empty, Memory<T>.Empty);
629public readonly (Memory<T> first, Memory<T> second) Current => _current;
635_current = (Memory<T>.Empty, Memory<T>.Empty);
709private Memory<T> _current;
718_current = Memory<T>.Empty;
721public readonly Memory<T> Current => _current;
727_current = Memory<T>.Empty;
758private Memory<T> _current;
767_current = Memory<T>.Empty;
770public readonly Memory<T> Current => _current;
776_current = Memory<T>.Empty;
Microsoft.Data.Analysis (3)
Microsoft.Data.Analysis.Tests (9)
ArrowStringColumnTests.cs (9)
27Memory<byte> dataMemory = new byte[] { 102, 111, 111, 98, 97, 114 };
28Memory<byte> nullMemory = new byte[] { 0, 0, 0, 0 };
29Memory<byte> offsetMemory = new byte[] { 0, 0, 0, 0, 3, 0, 0, 0, 6, 0, 0, 0 };
42Memory<byte> dataMemory = new Memory<byte>(bytes);
43Memory<byte> nullMemory = new byte[] { 0b1101 };
44Memory<byte> offsetMemory = new byte[] { 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0 };
64Memory<byte> dataMemory = new byte[] { 102, 111, 111, 98, 97, 114 };
65Memory<byte> nullMemory = new byte[] { 0, 0, 0, 0 };
66Memory<byte> offsetMemory = new byte[] { 0, 0, 0, 0, 3, 0, 0, 0, 6, 0, 0, 0 };
Microsoft.DotNet.HotReload.Watch (1)
Microsoft.Extensions.AI.Abstractions.Tests (11)
Microsoft.Extensions.AI.OpenAI (1)
Microsoft.Extensions.Caching.Hybrid (1)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
Microsoft.Extensions.Caching.SqlServer (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (4)
Microsoft.Extensions.Http.Diagnostics (6)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (1)
Microsoft.Extensions.Http.Diagnostics.Tests (4)
Microsoft.Extensions.Logging.Console (4)
Microsoft.Extensions.ServiceDiscovery.Dns (7)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (8)
Microsoft.ML.Tokenizers (3)
mscorlib (1)
netstandard (1)
Roslyn.Diagnostics.Analyzers (36)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (36)
27foreach (var memory in array.GetSegments(index, length))
67foreach (var memory in sourceArray.GetSegments(0, length))
162foreach (var memory in sourceArray.GetSegments(sourceIndex, length))
229foreach (var memory in array.GetSegments(startIndex, count))
462private (Memory<T> first, Memory<T> second) _current;
473_current = (Memory<T>.Empty, Memory<T>.Empty);
476public readonly (Memory<T> first, Memory<T> second) Current => _current;
482_current = (Memory<T>.Empty, Memory<T>.Empty);
567private (Memory<T> first, Memory<T> second) _current;
578_current = (Memory<T>.Empty, Memory<T>.Empty);
581public readonly (Memory<T> first, Memory<T> second) Current => _current;
587_current = (Memory<T>.Empty, Memory<T>.Empty);
615private (Memory<T> first, Memory<T> second) _current;
626_current = (Memory<T>.Empty, Memory<T>.Empty);
629public readonly (Memory<T> first, Memory<T> second) Current => _current;
635_current = (Memory<T>.Empty, Memory<T>.Empty);
709private Memory<T> _current;
718_current = Memory<T>.Empty;
721public readonly Memory<T> Current => _current;
727_current = Memory<T>.Empty;
758private Memory<T> _current;
767_current = Memory<T>.Empty;
770public readonly Memory<T> Current => _current;
776_current = Memory<T>.Empty;
Shared (8)
Shared.Tests (11)
System.Collections.Immutable (5)
System.Formats.Tar (27)
System.IO.Compression (32)
System.IO.Compression.Brotli (6)
System\IO\Compression\enc\BrotliEncoder.cs (2)
123internal OperationStatus Flush(Memory<byte> destination, out int bytesWritten) => Flush(destination.Span, out bytesWritten);
131internal OperationStatus Compress(ReadOnlyMemory<byte> source, Memory<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) => Compress(source.Span, destination.Span, out bytesConsumed, out bytesWritten, isFinalBlock);
System.IO.IsolatedStorage (1)
System.IO.Pipelines (19)
System.IO.Pipes (2)
System.IO.Ports (4)
System.Memory (13)
System.Net.Http (42)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (9)
426await _stream.ReadAsync(Memory<byte>.Empty).ConfigureAwait(false);
473await _stream.ReadAsync(Memory<byte>.Empty).ConfigureAwait(false);
547ValueTask<int> zeroByteReadTask = _stream.ReadAsync(Memory<byte>.Empty);
1185public abstract bool InvokeWriteAction(Memory<byte> writeBuffer);
1191private readonly Func<T, Memory<byte>, bool> _writeAction;
1193public WriteQueueEntry(int writeBytes, T state, Func<T, Memory<byte>, bool> writeAction, CancellationToken cancellationToken)
1200public override bool InvokeWriteAction(Memory<byte> writeBuffer)
1206private Task PerformWriteAsync<T>(int writeBytes, T state, Func<T, Memory<byte>, bool> writeAction, CancellationToken cancellationToken = default)
1406(buffer, Memory<byte>.Empty);
System.Net.Http.Json (1)
System.Net.Mail (18)
src\runtime\src\libraries\Common\src\System\ReadWriteAdapter.cs (9)
20static abstract ValueTask<int> ReadAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken);
21static abstract ValueTask<int> ReadAtLeastAsync(Stream stream, Memory<byte> buffer, int minimumBytes, bool throwOnEndOfStream, CancellationToken cancellationToken);
22static abstract ValueTask ReadExactlyAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken);
34public static ValueTask<int> ReadAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken) =>
37public static ValueTask<int> ReadAtLeastAsync(Stream stream, Memory<byte> buffer, int minimumBytes, bool throwOnEndOfStream, CancellationToken cancellationToken) =>
40public static ValueTask ReadExactlyAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken) =>
60public static ValueTask<int> ReadAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken) =>
63public static ValueTask<int> ReadAtLeastAsync(Stream stream, Memory<byte> buffer, int minimumBytes, bool throwOnEndOfStream, CancellationToken cancellationToken) =>
66public static ValueTask ReadExactlyAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken)
System.Net.NameResolution (5)
System.Net.Primitives (1)
System.Net.Quic (13)
System.Net.Requests (2)
System.Net.Security (20)
src\runtime\src\libraries\Common\src\System\ReadWriteAdapter.cs (9)
20static abstract ValueTask<int> ReadAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken);
21static abstract ValueTask<int> ReadAtLeastAsync(Stream stream, Memory<byte> buffer, int minimumBytes, bool throwOnEndOfStream, CancellationToken cancellationToken);
22static abstract ValueTask ReadExactlyAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken);
34public static ValueTask<int> ReadAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken) =>
37public static ValueTask<int> ReadAtLeastAsync(Stream stream, Memory<byte> buffer, int minimumBytes, bool throwOnEndOfStream, CancellationToken cancellationToken) =>
40public static ValueTask ReadExactlyAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken) =>
60public static ValueTask<int> ReadAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken) =>
63public static ValueTask<int> ReadAtLeastAsync(Stream stream, Memory<byte> buffer, int minimumBytes, bool throwOnEndOfStream, CancellationToken cancellationToken) =>
66public static ValueTask ReadExactlyAsync(Stream stream, Memory<byte> buffer, CancellationToken cancellationToken)
System.Net.ServerSentEvents (4)
System.Net.Sockets (101)
System\Net\Sockets\Socket.Tasks.cs (8)
277public ValueTask<int> ReceiveAsync(Memory<byte> buffer, CancellationToken cancellationToken = default) =>
287public ValueTask<int> ReceiveAsync(Memory<byte> buffer, SocketFlags socketFlags, CancellationToken cancellationToken = default) =>
290internal ValueTask<int> ReceiveAsync(Memory<byte> buffer, SocketFlags socketFlags, bool fromNetworkStream, CancellationToken cancellationToken)
367public ValueTask<SocketReceiveFromResult> ReceiveFromAsync(Memory<byte> buffer, EndPoint remoteEndPoint, CancellationToken cancellationToken = default) =>
378public ValueTask<SocketReceiveFromResult> ReceiveFromAsync(Memory<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint, CancellationToken cancellationToken = default)
412public ValueTask<int> ReceiveFromAsync(Memory<byte> buffer, SocketFlags socketFlags, SocketAddress receivedAddress, CancellationToken cancellationToken = default)
469public ValueTask<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(Memory<byte> buffer, EndPoint remoteEndPoint, CancellationToken cancellationToken = default) =>
480public ValueTask<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(Memory<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint, CancellationToken cancellationToken = default)
System\Net\Sockets\SocketAsyncContext.Unix.cs (67)
131public Memory<byte> SocketAddress;
359public Action<int, Memory<byte>, SocketFlags, SocketError>? Callback { get; set; }
367public Memory<byte> Buffer;
381Memory<byte> sa = SocketAddress;
409Memory<byte> sa = SocketAddress;
443public Action<int, Memory<byte>, SocketFlags, SocketError>? Callback { get; set; }
451public Memory<byte> Buffer;
492Memory<byte> sa = SocketAddress;
525Memory<byte> sa = SocketAddress;
558public Memory<byte> Buffer;
570public Action<int, Memory<byte>, SocketFlags, IPPacketInformation, SocketError>? Callback { get; set; }
600public Action<int, Memory<byte>, SocketFlags, IPPacketInformation, SocketError>? Callback { get; set; }
622public Action<IntPtr, Memory<byte>, SocketError>? Callback { get; set; }
639Memory<byte> sa = SocketAddress;
662SocketError error = context.SendToAsync(Buffer, 0, Buffer.Length, SocketFlags.None, Memory<byte>.Empty, ref BytesTransferred, Callback!, default);
675Memory<byte> sa = SocketAddress;
677Memory<byte> buffer = Buffer;
1470public SocketError Accept(Memory<byte> socketAddress, out int socketAddressLen, out IntPtr acceptedFd)
1495public SocketError AcceptAsync(Memory<byte> socketAddress, out int socketAddressLen, out IntPtr acceptedFd, Action<IntPtr, Memory<byte>, SocketError> callback, CancellationToken cancellationToken)
1531public SocketError Connect(Memory<byte> socketAddress)
1560public SocketError ConnectAsync(Memory<byte> socketAddress, Action<int, Memory<byte>, SocketFlags, SocketError> callback, Memory<byte> buffer, out int sentBytes, CancellationToken cancellationToken)
1585errorCode = SendToAsync(buffer.Slice(sentBytes), 0, remains, SocketFlags.None, Memory<byte>.Empty, ref sentBytes, callback!, default);
1621public SocketError Receive(Memory<byte> buffer, SocketFlags flags, int timeout, out int bytesReceived)
1623return ReceiveFrom(buffer, ref flags, Memory<byte>.Empty, out int _, timeout, out bytesReceived);
1628return ReceiveFrom(buffer, ref flags, Memory<byte>.Empty, out int _, timeout, out bytesReceived);
1631public SocketError ReceiveAsync(Memory<byte> buffer, SocketFlags flags, out int bytesReceived, out SocketFlags receivedFlags, Action<int, Memory<byte>, SocketFlags, SocketError> callback, CancellationToken cancellationToken)
1633return ReceiveFromAsync(buffer, flags, Memory<byte>.Empty, out int _, out bytesReceived, out receivedFlags, callback, cancellationToken);
1636public SocketError ReceiveFrom(Memory<byte> buffer, ref SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, int timeout, out int bytesReceived)
1669public unsafe SocketError ReceiveFrom(Span<byte> buffer, ref SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, int timeout, out int bytesReceived)
1703public SocketError ReceiveAsync(Memory<byte> buffer, SocketFlags flags, out int bytesReceived, Action<int, Memory<byte>, SocketFlags, SocketError> callback, CancellationToken cancellationToken = default)
1735public SocketError ReceiveFromAsync(Memory<byte> buffer, SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out SocketFlags receivedFlags, Action<int, Memory<byte>, SocketFlags, SocketError> callback, CancellationToken cancellationToken = default)
1773return ReceiveFrom(buffers, ref flags, Memory<byte>.Empty, out int _, timeout, out bytesReceived);
1776public SocketError ReceiveAsync(IList<ArraySegment<byte>> buffers, SocketFlags flags, out int bytesReceived, out SocketFlags receivedFlags, Action<int, Memory<byte>, SocketFlags, SocketError> callback)
1778return ReceiveFromAsync(buffers, flags, Memory<byte>.Empty, out int _, out bytesReceived, out receivedFlags, callback);
1781public SocketError ReceiveFrom(IList<ArraySegment<byte>> buffers, ref SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, int timeout, out int bytesReceived)
1813public SocketError ReceiveFromAsync(IList<ArraySegment<byte>> buffers, SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out SocketFlags receivedFlags, Action<int, Memory<byte>, SocketFlags, SocketError> callback)
1850Memory<byte> buffer, ref SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, int timeout, out IPPacketInformation ipPacketInformation, out int bytesReceived)
1887Span<byte> buffer, ref SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, int timeout, out IPPacketInformation ipPacketInformation, out int bytesReceived)
1926public SocketError ReceiveMessageFromAsync(Memory<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, out int bytesReceived, out SocketFlags receivedFlags, out IPPacketInformation ipPacketInformation, Action<int, Memory<byte>, SocketFlags, IPPacketInformation, SocketError> callback, CancellationToken cancellationToken = default)
1966SendTo(buffer, flags, Memory<byte>.Empty, timeout, out bytesSent);
1970return SendTo(buffer, offset, count, flags, Memory<byte>.Empty, timeout, out bytesSent);
1973public SocketError SendAsync(Memory<byte> buffer, int offset, int count, SocketFlags flags, out int bytesSent, Action<int, Memory<byte>, SocketFlags, SocketError> callback, CancellationToken cancellationToken)
1976return SendToAsync(buffer, offset, count, flags, Memory<byte>.Empty, ref bytesSent, callback, cancellationToken);
1979public SocketError SendTo(byte[] buffer, int offset, int count, SocketFlags flags, Memory<byte> socketAddress, int timeout, out int bytesSent)
2011public unsafe SocketError SendTo(ReadOnlySpan<byte> buffer, SocketFlags flags, Memory<byte> socketAddress, int timeout, out int bytesSent)
2047public SocketError SendToAsync(Memory<byte> buffer, int offset, int count, SocketFlags flags, Memory<byte> socketAddress, ref int bytesSent, Action<int, Memory<byte>, SocketFlags, SocketError> callback, CancellationToken cancellationToken = default)
2082return SendTo(buffers, flags, Memory<byte>.Empty, timeout, out bytesSent);
2085public SocketError SendAsync(IList<ArraySegment<byte>> buffers, SocketFlags flags, out int bytesSent, Action<int, Memory<byte>, SocketFlags, SocketError> callback)
2087return SendToAsync(buffers, flags, Memory<byte>.Empty, out bytesSent, callback);
2090public SocketError SendTo(IList<ArraySegment<byte>> buffers, SocketFlags flags, Memory<byte> socketAddress, int timeout, out int bytesSent)
2124public SocketError SendToAsync(IList<ArraySegment<byte>> buffers, SocketFlags flags, Memory<byte> socketAddress, out int bytesSent, Action<int, Memory<byte>, SocketFlags, SocketError> callback)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (10)
16private Action<int, Memory<byte>, SocketFlags, SocketError>? _transferCompletionCallback;
26private void AcceptCompletionCallback(IntPtr acceptedFileDescriptor, Memory<byte> socketAddress, SocketError socketError)
33private void CompleteAcceptOperation(IntPtr acceptedFileDescriptor, Memory<byte> socketAddress, SocketError socketError)
69private void ConnectCompletionCallback(int bytesTransferred, Memory<byte> socketAddress, SocketFlags receivedFlags, SocketError socketError)
86SocketError socketError = handle.AsyncContext.ConnectAsync(_socketAddress!.Buffer, ConnectCompletionCallback, Memory<byte>.Empty, out int _, cancellationToken);
101private Action<int, Memory<byte>, SocketFlags, SocketError> TransferCompletionCallback =>
104private void TransferCompletionCallbackCore(int bytesTransferred, Memory<byte> socketAddress, SocketFlags receivedFlags, SocketError socketError)
111private void CompleteTransferOperation(Memory<byte> _, int socketAddressSize, SocketFlags receivedFlags)
180private void ReceiveMessageFromCompletionCallback(int bytesTransferred, Memory<byte> socketAddress, SocketFlags receivedFlags, IPPacketInformation ipPacketInformation, SocketError errorCode)
187private void CompleteReceiveMessageFromOperation(Memory<byte> socketAddress, int socketAddressSize, SocketFlags receivedFlags, IPPacketInformation ipPacketInformation)
System\Net\Sockets\SocketPal.Unix.cs (10)
626public static unsafe bool TryCompleteAccept(SafeSocketHandle socket, Memory<byte> socketAddress, out int socketAddressLen, out IntPtr acceptedFd, out SocketError errorCode)
669public static bool TryStartConnect(SafeSocketHandle socket, Memory<byte> socketAddress, out SocketError errorCode) => TryStartConnect(socket, socketAddress, out errorCode, Span<byte>.Empty, false, out int _ );
671public static unsafe bool TryStartConnect(SafeSocketHandle socket, Memory<byte> socketAddress, out SocketError errorCode, Span<byte> data, bool tfo, out int sent)
903public static bool TryCompleteReceiveMessageFrom(SafeSocketHandle socket, Span<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, Memory<byte> socketAddress, out int receivedSocketAddressLength, bool isIPv4, bool isIPv6, out int bytesReceived, out SocketFlags receivedFlags, out IPPacketInformation ipPacketInformation, out SocketError errorCode)
1133public static SocketError Accept(SafeSocketHandle listenSocket, Memory<byte> socketAddress, out int socketAddressLen, out SafeSocketHandle socket)
1158public static SocketError Connect(SafeSocketHandle handle, Memory<byte> socketAddress)
1236public static SocketError SendTo(SafeSocketHandle handle, byte[] buffer, int offset, int count, SocketFlags socketFlags, Memory<byte> socketAddress, out int bytesTransferred)
1249public static SocketError SendTo(SafeSocketHandle handle, ReadOnlySpan<byte> buffer, SocketFlags socketFlags, Memory<byte> socketAddress, out int bytesTransferred)
1355public static SocketError ReceiveFrom(SafeSocketHandle handle, byte[] buffer, int offset, int count, SocketFlags socketFlags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesTransferred)
1367public static SocketError ReceiveFrom(SafeSocketHandle handle, Span<byte> buffer, SocketFlags socketFlags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesTransferred)
System.Net.WebClient (1)
System.Net.WebSockets (11)
System.Net.WebSockets.Client (4)
System.Private.CoreLib (120)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (6)
309public virtual ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
319static async ValueTask<int> FinishReadAsync(Task<int> readTask, byte[] localBuffer, Memory<byte> localDestination)
347public ValueTask ReadExactlyAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
418public ValueTask<int> ReadAtLeastAsync(Memory<byte> buffer, int minimumBytes, bool throwOnEndOfStream = true, CancellationToken cancellationToken = default)
428private async ValueTask<int> ReadAtLeastAsyncCore(Memory<byte> buffer, int minimumBytes, bool throwOnEndOfStream, CancellationToken cancellationToken)
1057public override ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken) =>
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (10)
274public virtual ValueTask<int> ReadAsync(Memory<char> buffer, CancellationToken cancellationToken = default) =>
279var t = (TupleSlim<TextReader, Memory<char>>)state!;
281}, new TupleSlim<TextReader, Memory<char>>(this, buffer), cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default));
283internal virtual ValueTask<int> ReadAsyncInternal(Memory<char> buffer, CancellationToken cancellationToken) =>
286var t = (TupleSlim<TextReader, Memory<char>>)state!;
288}, new TupleSlim<TextReader, Memory<char>>(this, buffer), cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default));
304public virtual ValueTask<int> ReadBlockAsync(Memory<char> buffer, CancellationToken cancellationToken = default) =>
309var t = (TupleSlim<TextReader, Memory<char>>)state!;
311}, new TupleSlim<TextReader, Memory<char>>(this, buffer), cancellationToken, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default));
313internal async ValueTask<int> ReadBlockAsyncInternal(Memory<char> buffer, CancellationToken cancellationToken)
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (9)
3830public static Memory<T> AsMemory<T>(this T[]? array) => new Memory<T>(array);
3843public static Memory<T> AsMemory<T>(this T[]? array, int start) => new Memory<T>(array, start);
3849public static Memory<T> AsMemory<T>(this T[]? array, Index startIndex)
3875public static Memory<T> AsMemory<T>(this T[]? array, int start, int length) => new Memory<T>(array, start, length);
3881public static Memory<T> AsMemory<T>(this T[]? array, Range range)
3900public static Memory<T> AsMemory<T>(this ArraySegment<T> segment) => new Memory<T>(segment.Array, segment.Offset, segment.Count);
3913public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start)
3933public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start, int length)
3970public static void CopyTo<T>(this T[]? source, Memory<T> destination)
System.Runtime (1)
System.Security.Cryptography (40)
System.Security.Cryptography.Pkcs (4)
System.ServiceModel.NetFramingBase (35)
System\ServiceModel\Channels\Connection.cs (11)
17ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout);
38public virtual ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout) => Connection.ReadAsync(buffer, timeout);
45private Memory<byte> _preReadData;
47public PreReadConnection(IConnection innerConnection, Memory<byte> initialData)
53public void AddPreReadData(Memory<byte> initialData)
57Memory<byte> tempBuffer = _preReadData;
68public override ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout)
204Memory<byte> memBuffer = new Memory<byte>(sharedBuffer, 0, buffer.Length);
235public override ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
243Memory<byte> memBuffer = new Memory<byte>(sharedBuffer, 0, buffer.Length);
292public async ValueTask<int> ReadAsync(Memory<byte> buffer, TimeSpan timeout)
System.ServiceModel.NetNamedPipe (1)
System.ServiceModel.NetTcp (3)
System.ServiceModel.Primitives (4)
System.ServiceModel.UnixDomainSocket (3)
System.Text.Json (19)
System.Text.Json.SourceGeneration (1)