52 references to ReadOnlyMemory
InMemory.FunctionalTests (1)
Http3\WebTransport\WebTransportStreamTests.cs (1)
41var input = new ReadOnlyMemory<byte>(RandomBytes);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\WebTransport\WebTransportSession.cs (1)
32private static readonly ReadOnlyMemory<byte> OutputStreamHeader = new(new byte[] {
Microsoft.AspNetCore.WebUtilities.Tests (6)
HttpResponseStreamWriterTest.cs (6)
370var memory = new ReadOnlyMemory<char>(array); 384var memory = new ReadOnlyMemory<char>(new char[] { 'a' }); 426var memory = new ReadOnlyMemory<char>(array); 440var memory = new ReadOnlyMemory<char>(new char[] { 'a' }); 895await httpResponseStreamWriter.WriteAsync(new ReadOnlyMemory<char>(new char[] { 'a', 'b' })); 899await httpResponseStreamWriter.WriteLineAsync(new ReadOnlyMemory<char>(new char[] { 'a', 'b' }));
Microsoft.CodeAnalysis.Remote.Workspaces (1)
SolutionAssetStorage.Scope.cs (1)
101var checksums = new ReadOnlyMemory<Checksum>([checksum]);
Microsoft.Extensions.AI.Abstractions.Tests (2)
Contents\DataContentTests.cs (2)
121new DataContent(new ReadOnlyMemory<byte>([0x01, 0x02, 0x03, 0x04]), "application/octet-stream"), 127new DataContent(new ReadOnlyMemory<byte>([0x01, 0x02, 0x03, 0x04]), "application/octet-stream") { Name = "test.bin" },
Microsoft.ML.AutoML (1)
ColumnInference\PurposeInference.cs (1)
99var copy = new ReadOnlyMemory<char>(value.ToArray());
Microsoft.ML.Data (3)
Evaluators\MulticlassClassificationEvaluator.cs (1)
226dst = new VBuffer<ReadOnlyMemory<char>>(allTopK.First().Length, Enumerable.Range(1, allTopK.First().Length).Select(i => new ReadOnlyMemory<char>(i.ToString().ToCharArray())).ToArray());
Scorers\FeatureContributionCalculation.cs (2)
219? new ReadOnlyMemory<char>($"f{index}".ToCharArray()) 258dst = new ReadOnlyMemory<char>(sb.ToString().ToCharArray());
Microsoft.ML.FastTree (2)
Utils\RegressionTreeBaseUtils.cs (2)
50isLeaf.AddRange(Enumerable.Repeat(new ReadOnlyMemory<char>("Tree node".ToCharArray()), trees[i].NumberOfNodes)); 51isLeaf.AddRange(Enumerable.Repeat(new ReadOnlyMemory<char>("Leaf node".ToCharArray()), trees[i].NumberOfLeaves));
Microsoft.ML.IntegrationTests (1)
Datasets\TypeTestData.cs (1)
154return new ReadOnlyMemory<char>(chars);
Microsoft.ML.TorchSharp (1)
Roberta\QATrainer.cs (1)
927outputCache.PredictedAnswersBuffer[index] = new ReadOnlyMemory<char>(_parent.Tokenizer.Decode(_parent.Tokenizer.RobertaModel().ConvertOccurrenceRanksToIds(contextIds).ToArray().AsSpan(predictStart - questionLength - 2, predictEnd - predictStart).ToArray()).Trim().ToCharArray());
Microsoft.ML.Transforms (3)
Expression\BuiltinFunctions.cs (3)
723return new TX(dst); 743return new TX(dst); 753return new TX(dst);
System.Collections.Immutable (1)
System\Collections\Immutable\ImmutableArray_1.cs (1)
105public ReadOnlyMemory<T> AsMemory() => new ReadOnlyMemory<T>(array);
System.Net.Http (1)
System\Net\Http\MultipartContent.cs (1)
340return stream.WriteAsync(new ReadOnlyMemory<byte>(buffer), cancellationToken);
System.Net.WebClient (2)
System\Net\WebClient.cs (2)
1025await writeStream.WriteAsync(new ReadOnlyMemory<byte>(header)).ConfigureAwait(false); 1063await writeStream.WriteAsync(new ReadOnlyMemory<byte>(footer)).ConfigureAwait(false);
System.Private.CoreLib (4)
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (2)
833return AppendAllBytesAsync(path, new ReadOnlyMemory<byte>(bytes), cancellationToken); 1263return WriteAllBytesAsync(path, new ReadOnlyMemory<byte>(bytes), cancellationToken);
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
985await _stream.WriteAsync(new ReadOnlyMemory<byte>(preamble), cancellationToken).ConfigureAwait(false);
src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (1)
111public static implicit operator ReadOnlyMemory<T>(T[]? array) => new ReadOnlyMemory<T>(array);
System.Security.Cryptography (15)
src\libraries\Common\src\System\Security\Cryptography\Asn1\AttributeAsn.manual.cs (1)
18AttrValues = new[] { new ReadOnlyMemory<byte>(attribute.RawData) };
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (2)
139new ReadOnlyMemory<byte>(data), 380new ReadOnlyMemory<byte>(data),
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (2)
636AttrValues = new[] { new ReadOnlyMemory<byte>(writer.Encode()) } 648AttrValues = new[] { new ReadOnlyMemory<byte>(writer.Encode()) }
System\Security\Cryptography\CryptographicOperations.cs (3)
661return HmacDataAsync(hashAlgorithm, new ReadOnlyMemory<byte>(key), source, cancellationToken); 1040new ReadOnlyMemory<byte>(key), 1042new ReadOnlyMemory<byte>(hash),
System\Security\Cryptography\CryptoStream.cs (1)
149await _stream.WriteAsync(new ReadOnlyMemory<byte>(finalBytes), cancellationToken).ConfigureAwait(false);
System\Security\Cryptography\HMACStatic.cs (3)
135return HashDataAsync(new ReadOnlyMemory<byte>(key), source, cancellationToken); 249return VerifyAsync(new ReadOnlyMemory<byte>(key), source, new ReadOnlyMemory<byte>(hash), cancellationToken);
System\Security\Cryptography\KmacStatic.cs (3)
153new ReadOnlyMemory<byte>(key), 155new ReadOnlyMemory<byte>(hash), 156new ReadOnlyMemory<byte>(customizationString), // null to empty conversion is expected.
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHeaderValue.cs (1)
39var encodedValueCopy = new ReadOnlyMemory<byte>(encodedValue.ToArray());
System.Security.Cryptography.Pkcs (4)
src\libraries\Common\src\System\Security\Cryptography\Asn1\AttributeAsn.manual.cs (1)
18AttrValues = new[] { new ReadOnlyMemory<byte>(attribute.RawData) };
System\Security\Cryptography\Pkcs\CmsSigner.cs (2)
253AttrValues = new[] { new ReadOnlyMemory<byte>(writer.Encode()) }, 265AttrValues = new[] { new ReadOnlyMemory<byte>(writer.Encode()) },
System\Security\Cryptography\Pkcs\SignerInfo.cs (1)
321AttrValues = new[] { new ReadOnlyMemory<byte>(writer.Encode()) },
System.Text.RegularExpressions.Generator (1)
Stubs.cs (1)
30return [new ReadOnlyMemory<char>(chars)];
WebTransportInteractiveSampleApp (1)
Program.cs (1)
148await stream.Transport.Output.WriteAsync(new("Created a new stream from the client and sent this message then closing the stream."u8.ToArray()));