207 references to AsMemory
http2cat (1)
HttpStress (1)
IIS.Common.TestLib (1)
IIS.FunctionalTests (1)
IIS.LongTests (1)
IIS.NewHandler.FunctionalTests (1)
IIS.NewShim.FunctionalTests (1)
IIS.ShadowCopy.Tests (1)
IISExpress.FunctionalTests (1)
InMemory.FunctionalTests (6)
Interop.FunctionalTests (3)
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.Server (5)
Microsoft.AspNetCore.Components.WebAssembly (1)
Microsoft.AspNetCore.Components.WebView (1)
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Microsoft.AspNetCore.Http (3)
Microsoft.AspNetCore.Http.Connections (4)
Microsoft.AspNetCore.Http.Connections.Client (1)
Microsoft.AspNetCore.Http.Extensions (3)
Microsoft.AspNetCore.Http.Results (2)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Microsoft.AspNetCore.OpenApi (3)
Microsoft.AspNetCore.OutputCaching (1)
Microsoft.AspNetCore.RequestDecompression (1)
Microsoft.AspNetCore.ResponseCaching (1)
Microsoft.AspNetCore.ResponseCompression (1)
Microsoft.AspNetCore.Routing.FunctionalTests (1)
Microsoft.AspNetCore.Server.HttpSys (1)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
Microsoft.AspNetCore.Server.IIS (1)
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
Microsoft.AspNetCore.Shared.Tests (3)
Microsoft.AspNetCore.SignalR.Client.Core (1)
Microsoft.AspNetCore.SignalR.Client.Tests (3)
Microsoft.AspNetCore.SignalR.Common (3)
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (3)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (3)
Microsoft.AspNetCore.SignalR.Specification.Tests (3)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.SignalR.Tests (1)
Microsoft.AspNetCore.TestHost (1)
Microsoft.AspNetCore.TestHost.Tests (1)
Microsoft.AspNetCore.WebSockets.Tests (2)
Microsoft.AspNetCore.WebUtilities (17)
Microsoft.AspNetCore.WebUtilities.Tests (10)
FileBufferingReadStreamTests.cs (9)
522Assert.Equal(data.AsMemory(0, 100).ToArray(), buffer);
540Assert.Equal(data.AsMemory(0, read).ToArray(), buffer);
559Assert.Equal(data.AsMemory(0, read).ToArray(), buffer);
579Assert.Equal(data.AsMemory(0, read1).ToArray(), buffer);
580Assert.Equal(data.AsMemory(0, read2).ToArray(), buffer2.AsMemory(0, read2).ToArray());
599Assert.Equal(data.AsMemory(0, read1).ToArray(), buffer);
600Assert.Equal(data.AsMemory(0, read2).ToArray(), buffer2.AsMemory(0, read2).ToArray());
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Http.Diagnostics (1)
Microsoft.ML.Tokenizers (4)
Model\TiktokenTokenizer.cs (4)
331(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1));
448(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1));
613(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1));
739(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1));
MSBuild (1)
Shared (1)
Sockets.FunctionalTests (3)
System.Formats.Tar (7)
System.IO.Compression (12)
System\IO\Compression\ZipArchiveEntry.Async.cs (5)
363await _archive.ArchiveStream.WriteAsync(writeBuffer.AsMemory(0, MetadataBufferLength), cancellationToken).ConfigureAwait(false);
369await _archive.ArchiveStream.WriteAsync(writeBuffer.AsMemory(0, CrcAndSizesBufferLength), cancellationToken).ConfigureAwait(false);
380await _archive.ArchiveStream.WriteAsync(writeBuffer.AsMemory(0, Zip64SizesBufferLength), cancellationToken).ConfigureAwait(false);
392await _archive.ArchiveStream.WriteAsync(writeBuffer.AsMemory(0, Zip64DataDescriptorCrcAndSizesBufferLength), cancellationToken).ConfigureAwait(false);
401return _archive.ArchiveStream.WriteAsync(dataDescriptor.AsMemory(0, bytesToWrite), cancellationToken);
System.Memory (1)
System.Memory.Data (1)
System.Net.Http (11)
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (9)
89await WriteAsync(stream, buffer.AsMemory(0, buffer[1] + 2), async).ConfigureAwait(false);
96await ReadToFillAsync(stream, buffer.AsMemory(0, 2), async).ConfigureAwait(false);
126await WriteAsync(stream, buffer.AsMemory(0, 3 + usernameLength + passwordLength), async).ConfigureAwait(false);
133await ReadToFillAsync(stream, buffer.AsMemory(0, 2), async).ConfigureAwait(false);
184await WriteAsync(stream, buffer.AsMemory(0, addressLength + 6), async).ConfigureAwait(false);
191await ReadToFillAsync(stream, buffer.AsMemory(0, 5), async).ConfigureAwait(false);
204await ReadToFillAsync(stream, buffer.AsMemory(0, bytesToSkip), async).ConfigureAwait(false);
294await WriteAsync(stream, buffer.AsMemory(0, totalLength), async).ConfigureAwait(false);
300await ReadToFillAsync(stream, buffer.AsMemory(0, 8), async).ConfigureAwait(false);
System.Net.HttpListener (1)
System.Net.Mail (7)
System.Net.Quic (2)
System.Net.Requests (1)
System.Net.Security (2)
System.Net.Sockets (4)
System.Private.CoreLib (2)
System.Private.Xml (5)
System.Security.Cryptography (11)
System\Security\Cryptography\CryptoStream.cs (6)
220return ReadAsyncInternal(buffer.AsMemory(offset, count), cancellationToken).AsTask();
295ValueTask<int> completedValueTask = ReadAsyncCore(buffer.AsMemory(offset, count), default(CancellationToken), useAsync: false);
459return WriteAsyncInternal(buffer.AsMemory(offset, count), cancellationToken).AsTask();
499WriteAsyncCore(buffer.AsMemory(offset, count), default, useAsync: false).AsTask().GetAwaiter().GetResult();
730bytesRead = await ReadAsync(rentedBuffer.AsMemory(0, bufferSize), cancellationToken).ConfigureAwait(false);
731await destination.WriteAsync(rentedBuffer.AsMemory(0, bytesRead), cancellationToken).ConfigureAwait(false);
System.Security.Cryptography.Cose (3)
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (2)
408await WriteSignatureAsync(writer, signer, buffer, buffer.AsMemory(0, protectedMapBytesWritten), associatedData, content, cancellationToken).ConfigureAwait(false);
485await AppendToBeSignedAsync(buffer, hasher, SigStructureContext.Signature, bodyProtected, buffer.AsMemory(start, signProtectedBytesWritten), associatedData, contentStream, cancellationToken).ConfigureAwait(false);
System.Security.Cryptography.Pkcs (1)
System.Text.Json (4)
System\Text\Json\Document\JsonDocument.Parse.cs (4)
92return Parse(utf8Bytes.AsMemory(0, length), readerOptions, utf8Bytes);
272utf8Bytes.AsMemory(0, actualByteCount),
632document = Parse(rented.AsMemory(0, length), state.Options, rented);
864lastRead = await stream.ReadAsync(rented.AsMemory(written, utf8BomLength - written), cancellationToken).ConfigureAwait(false);