755 references to AsSpan
Aspire.Hosting (1)
Aspire.Hosting.Docker (1)
http2cat (2)
IIS.FunctionalTests (2)
IIS.LongTests (2)
IIS.NewHandler.FunctionalTests (2)
IIS.NewShim.FunctionalTests (2)
IISExpress.FunctionalTests (2)
InMemory.FunctionalTests (7)
Microsoft.AspNetCore.Components (3)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.Server (9)
Microsoft.AspNetCore.Components.WebView (1)
Microsoft.AspNetCore.Cryptography.Internal.Tests (4)
Microsoft.AspNetCore.DataProtection (8)
Microsoft.AspNetCore.DataProtection.Abstractions (3)
Microsoft.AspNetCore.Diagnostics.Middleware (2)
Microsoft.AspNetCore.Http.Connections (9)
Microsoft.AspNetCore.Http.Connections.Common (1)
Microsoft.AspNetCore.Http.Extensions (1)
Microsoft.AspNetCore.HttpLogging (3)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
Microsoft.AspNetCore.OpenApi (8)
Microsoft.AspNetCore.OutputCaching (3)
Microsoft.AspNetCore.ResponseCaching (1)
Microsoft.AspNetCore.Server.HttpSys (2)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
Microsoft.AspNetCore.Server.Kestrel.Core (8)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
Microsoft.AspNetCore.Shared.Tests (20)
UrlDecoderTests.cs (11)
21Assert.True(destination.AsSpan(0, length).SequenceEqual(expected.AsSpan()));
30Assert.True(destination.AsSpan(0, length).SequenceEqual(expected.AsSpan()));
40Assert.True(destination.AsSpan(0, length).SequenceEqual(expected.AsSpan()));
50Assert.True(destination.AsSpan(0, length).SequenceEqual(expected.AsSpan()));
57Assert.Throws<ArgumentException>(() => UrlDecoder.DecodeRequestLine(source.AsSpan(), source.AsSpan(0, 1)));
64Assert.Throws<ArgumentException>(() => UrlDecoder.DecodeRequestLine(source.AsSpan(), source.AsSpan(0, 1), false));
108Assert.True(source.AsSpan(0, length).SequenceEqual(input.AsSpan()));
122Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes(input).AsSpan()));
132Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes("/").AsSpan()));
146Assert.True(source.AsSpan(0, length).SequenceEqual(input.AsSpan()));
160Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes(input).AsSpan()));
Microsoft.AspNetCore.SignalR.Client.Tests (6)
Microsoft.AspNetCore.SignalR.Common (7)
Microsoft.AspNetCore.SignalR.Common.Tests (3)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (6)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (7)
Microsoft.AspNetCore.SignalR.Specification.Tests (6)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (6)
Microsoft.AspNetCore.SignalR.Tests (2)
Microsoft.AspNetCore.WebUtilities (10)
Microsoft.Build (3)
Microsoft.Build.Tasks.Core (3)
Microsoft.CodeAnalysis (7)
Microsoft.CodeAnalysis.CodeStyle (4)
Microsoft.CodeAnalysis.Workspaces (4)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (4)
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
XxHash128Tests.cs (3)
53Assert.False(XxHash128.TryHash(input, destination.AsSpan(0, destination.Length - 1), out int bytesWritten, test.Seed));
119Assert.Equal(XxHash128.HashToUInt128(asciiBytes.AsSpan(0, processed), test.Seed), hash.GetCurrentHashAsUInt128());
122Assert.Equal(16, XxHash128.Hash(asciiBytes.AsSpan(0, processed), destination2, test.Seed));
Microsoft.DotNet.Build.Tasks.Installers (1)
Microsoft.Extensions.AI (1)
Microsoft.Extensions.AI.Abstractions (1)
Microsoft.Extensions.AI.AzureAIInference (1)
Microsoft.Extensions.AI.OpenAI (8)
src\Shared\ServerSentEvents\SseParser_1.cs (8)
137_newlineIndex = _lineBuffer.AsSpan(searchOffset, searchLength).IndexOfAny(CR, LF);
217_newlineIndex = _lineBuffer.AsSpan(searchOffset, searchLength).IndexOfAny(CR, LF);
293return _lineBuffer.AsSpan(_newlineIndex, _lineLength - (_newlineIndex - _lineOffset)).StartsWith(CRLF) ? 2 : 1;
313_lineBuffer.AsSpan(_lineOffset, _lineLength).CopyTo(_lineBuffer);
334ReadOnlySpan<byte> line = _lineBuffer.AsSpan(_lineOffset, _newlineIndex - _lineOffset);
343T data = _itemParser(_eventType ?? SseParser.EventTypeDefault, _dataBuffer.AsSpan(0, _dataLength));
392ReadOnlySpan<byte> remainder = _lineBuffer.AsSpan(_newlineIndex + newlineLength, _lineLength - line.Length - newlineLength);
550if (_lineBuffer.AsSpan(0, _lineLength).StartsWith(Utf8Bom))
Microsoft.Extensions.Caching.Hybrid (9)
Internal\HybridCachePayload.cs (5)
108BinaryPrimitives.WriteUInt16LittleEndian(destination.AsSpan(0, 2), UInt16SentinelPrefixPair);
109BinaryPrimitives.WriteUInt16LittleEndian(destination.AsSpan(2, 2), (ushort)_entropySource.Next(0, 0x010000)); // Next is exclusive at RHS
110BinaryPrimitives.WriteInt64LittleEndian(destination.AsSpan(4, 8), creationTime);
140payload.CopyTo(destination.AsSpan(len, payloadLength));
142BinaryPrimitives.WriteUInt16LittleEndian(destination.AsSpan(len, 2), UInt16SentinelPrefixPair);
Microsoft.Extensions.Compliance.Abstractions (1)
Microsoft.Extensions.DependencyModel (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (3)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
Microsoft.Extensions.Http.Diagnostics (2)
Microsoft.Extensions.Telemetry (1)
Microsoft.JSInterop (2)
Microsoft.ML.Core (8)
Microsoft.ML.CpuMath (6)
Microsoft.ML.CpuMath.PerformanceTests (11)
Microsoft.ML.Data (13)
Microsoft.ML.DataView (12)
VBuffer.cs (10)
65public ReadOnlySpan<T> GetValues() => _values.AsSpan(0, _count);
80public ReadOnlySpan<int> GetIndices() => IsDense ? default : _indices.AsSpan(0, _count);
184_values.AsSpan(0, Length).CopyTo(editor.Values);
200_values.AsSpan(0, Length).CopyTo(editor.Values);
209_values.AsSpan(0, _count).CopyTo(editor.Values);
210_indices.AsSpan(0, _count).CopyTo(editor.Indices);
233_values.AsSpan(sourceIndex, length).CopyTo(editor.Values);
250_values.AsSpan(copyMin, copyCount).CopyTo(editor.Values);
294_values.AsSpan(0, Length).CopyTo(destination.Slice(destinationIndex));
328source.AsSpan(sourceIndex, length).CopyTo(editor.Values);
Microsoft.ML.FastTree (9)
Microsoft.ML.PCA (1)
Microsoft.ML.StandardTrainers (3)
Microsoft.ML.TestFrameworkCommon (1)
Microsoft.ML.Tokenizers (7)
Microsoft.ML.Tokenizers.Tests (6)
BpeTests.cs (4)
837Assert.Equal(beginningOfSentenceToken + text, destinationBuffer.AsSpan(0, charsWritten).ToString());
840Assert.Equal(text, destinationBuffer.AsSpan(0, charsWritten).ToString());
842Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan(0, text.Length - 1), considerSpecialTokens: false, out idsConsumed, out charsWritten));
845Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan(0, text.Length), considerSpecialTokens: true, out idsConsumed, out charsWritten));
Microsoft.ML.TorchSharp (11)
Roberta\Models\RobertaModel.cs (8)
116var position = torch.tensor(DataUtils.Concat<int>(Positions.AsSpan(0, allSize), Zeros.AsSpan(0, size - allSize)),
118var segment = questionSize == size - 1 ? torch.tensor(Zeros.AsSpan(0, size).ToArray(), 1, size, dtype: torch.int64, device: device) :
119torch.tensor(DataUtils.Concat<int>(Zeros.AsSpan(0, questionSize + 2), Ones.AsSpan(0, allSize - questionSize - 2), Zeros.AsSpan(0, size - allSize)),
121var attentionMask = torch.tensor(DataUtils.Concat<int>(Zeros.AsSpan(0, allSize), NegBillionPad.AsSpan(0, size - allSize)),
Microsoft.ML.Transforms (1)
MSBuild (2)
PresentationCore (2)
PresentationFramework (6)
Shared (11)
ServerSentEvents\SseParser_1.cs (8)
137_newlineIndex = _lineBuffer.AsSpan(searchOffset, searchLength).IndexOfAny(CR, LF);
217_newlineIndex = _lineBuffer.AsSpan(searchOffset, searchLength).IndexOfAny(CR, LF);
293return _lineBuffer.AsSpan(_newlineIndex, _lineLength - (_newlineIndex - _lineOffset)).StartsWith(CRLF) ? 2 : 1;
313_lineBuffer.AsSpan(_lineOffset, _lineLength).CopyTo(_lineBuffer);
334ReadOnlySpan<byte> line = _lineBuffer.AsSpan(_lineOffset, _newlineIndex - _lineOffset);
343T data = _itemParser(_eventType ?? SseParser.EventTypeDefault, _dataBuffer.AsSpan(0, _dataLength));
392ReadOnlySpan<byte> remainder = _lineBuffer.AsSpan(_newlineIndex + newlineLength, _lineLength - line.Length - newlineLength);
550if (_lineBuffer.AsSpan(0, _lineLength).StartsWith(Utf8Bom))
System.Collections (7)
System.Collections.Immutable (9)
System.Console (4)
System.Data.Common (4)
System.Data.Odbc (3)
System.Diagnostics.DiagnosticSource (2)
System.Formats.Asn1 (8)
System.Formats.Cbor (8)
System.Formats.Tar (4)
System.IO.Compression (11)
System.IO.FileSystem.Watcher (3)
System.IO.Hashing (2)
System.Linq (3)
System.Memory (4)
System.Net.Http (17)
System.Net.HttpListener (1)
System.Net.Mail (14)
System.Net.Primitives (5)
System.Net.Quic (8)
System.Net.Security (14)
System.Net.ServerSentEvents (8)
System\Net\ServerSentEvents\SseParser_1.cs (8)
121_newlineIndex = _lineBuffer.AsSpan(searchOffset, searchLength).IndexOfAny(CR, LF);
201_newlineIndex = _lineBuffer.AsSpan(searchOffset, searchLength).IndexOfAny(CR, LF);
277return _lineBuffer.AsSpan(_newlineIndex, _lineLength - (_newlineIndex - _lineOffset)).StartsWith(CRLF) ? 2 : 1;
297_lineBuffer.AsSpan(_lineOffset, _lineLength).CopyTo(_lineBuffer);
317ReadOnlySpan<byte> line = _lineBuffer.AsSpan(_lineOffset, _newlineIndex - _lineOffset);
326T data = _itemParser(_eventType ?? SseParser.EventTypeDefault, _dataBuffer.AsSpan(0, _dataLength));
375ReadOnlySpan<byte> remainder = _lineBuffer.AsSpan(_newlineIndex + newlineLength, _lineLength - line.Length - newlineLength);
526if (_lineBuffer.AsSpan(0, _lineLength).StartsWith(Utf8Bom))
System.Net.Sockets (5)
System.Net.WebSockets (4)
System.Numerics.Tensors (11)
System\Numerics\Tensors\netcore\TensorShape.cs (10)
91destinationLengths = metadata.AsSpan(rank * 0, rank);
92destinationStrides = metadata.AsSpan(rank * 1, rank);
312destinationLengths = metadata.AsSpan(rank * 0, rank);
313destinationStrides = metadata.AsSpan(rank * 1, rank);
363return metadata.AsSpan(rank * 0, rank);
402return metadata.AsSpan(rank * 1, rank);
742lengths = lengthsArray.AsSpan(0, rank);
799intermediateLengths = intermediateLengthsArray.AsSpan(0, rank);
1093intermediateLengths = intermediateLengthsArray.AsSpan(0, rank);
1096intermediateStrides = intermediateStridesArray.AsSpan(0, rank);
System.Private.CoreLib (37)
System.Private.DataContractSerialization (64)
System\Xml\XmlBinaryReader.cs (11)
1241BufferReader.ReadRawArrayBytes(array.AsSpan(offset, actual));
1264BufferReader.ReadRawArrayBytes(array.AsSpan(offset, actual));
1287BufferReader.ReadRawArrayBytes(array.AsSpan(offset, actual));
1310BufferReader.ReadRawArrayBytes(array.AsSpan(offset, actual));
1333BufferReader.ReadRawArrayBytes(array.AsSpan(offset, actual));
1356BufferReader.ReadRawArrayBytes(array.AsSpan(offset, actual));
1379BufferReader.ReadRawArrayBytes(array.AsSpan(offset, actual));
1405foreach (ref DateTime item in array.AsSpan(offset, actual))
1434BufferReader.ReadRawArrayBytes(array.AsSpan(offset, actual));
1440foreach (ref Guid item in array.AsSpan(offset, actual))
1470foreach (ref TimeSpan item in array.AsSpan(offset, actual))
System\Xml\XmlBinaryWriter.cs (19)
572=> WriteTextImpl(chars.AsSpan(offset, count));
736Span<byte> span = GetTextNodeBuffer(1 + sizeof(float), out int offset).AsSpan(offset, 1 + sizeof(float));
761Span<byte> span = GetTextNodeBuffer(1 + sizeof(double), out int offset).AsSpan(offset, 1 + sizeof(double));
781Span<byte> span = GetTextNodeBuffer(1 + sizeof(decimal), out int offset).AsSpan(offset, 1 + sizeof(decimal));
813Span<byte> span = GetTextNodeBuffer(17, out int offset).AsSpan(offset, 17);
924Span<byte> span = GetBuffer(sizeof(float), out int bufferOffset).AsSpan(bufferOffset, sizeof(float));
942Span<byte> span = GetBuffer(sizeof(double), out int bufferOffset).AsSpan(bufferOffset, sizeof(double));
964Span<byte> span = GetBuffer(16, out int bufferOffset).AsSpan(bufferOffset, 16);
995Span<byte> bytes = GetBuffer(16, out int bufferOffset).AsSpan(bufferOffset, 16);
1300_writer.WriteBoolArray(array.AsSpan(offset, count));
1318_writer.WriteInt16Array(array.AsSpan(offset, count));
1336_writer.WriteInt32Array(array.AsSpan(offset, count));
1354_writer.WriteInt64Array(array.AsSpan(offset, count));
1372_writer.WriteFloatArray(array.AsSpan(offset, count));
1390_writer.WriteDoubleArray(array.AsSpan(offset, count));
1408_writer.WriteDecimalArray(array.AsSpan(offset, count));
1426_writer.WriteDateTimeArray(array.AsSpan(offset, count));
1444_writer.WriteGuidArray(array.AsSpan(offset, count));
1462_writer.WriteTimeSpanArray(array.AsSpan(offset, count));
System\Xml\XmlBufferReader.cs (12)
236int read = _stream.ReadAtLeast(_buffer.AsSpan(_offsetMax, needed), needed, throwOnEndOfStream: false);
377float f = BinaryPrimitives.ReadSingleLittleEndian(GetBuffer(sizeof(float), out int offset).AsSpan(offset, sizeof(float)));
384double d = BinaryPrimitives.ReadDoubleLittleEndian(GetBuffer(sizeof(double), out int offset).AsSpan(offset, sizeof(double)));
398ReadOnlySpan<byte> bytes = buffer.AsSpan(offset, sizeof(decimal));
496.AsSpan(_offset, dst.Length)
784return XmlConverter.IsWhitespace(_buffer.AsSpan(offset, length));
941.AsSpan(offset, sizeof(T));
949=> MemoryMarshal.Read<T>(_buffer.AsSpan(offset, sizeof(T)));
964=> BinaryPrimitives.ReadSingleLittleEndian(_buffer.AsSpan(offset, sizeof(float)));
967=> BinaryPrimitives.ReadDoubleLittleEndian(_buffer.AsSpan(offset, sizeof(double)));
977ReadOnlySpan<byte> bytes = _buffer.AsSpan(offset, sizeof(decimal));
994=> new Guid(_buffer.AsSpan(offset, ValueHandleLength.Guid));
System.Private.Uri (5)
System.Private.Xml (20)
System\Xml\Base64Decoder.cs (3)
53Decode(chars.AsSpan(startPos, len), _buffer.AsSpan(_curIndex, _endIndex - _curIndex), out int charsDecoded, out int bytesDecoded);
72Decode(str.AsSpan(startPos, len), _buffer.AsSpan(_curIndex, _endIndex - _curIndex), out int charsDecoded, out int bytesDecoded);
System.Reflection.Metadata (10)
System.Runtime.Numerics (4)
System.Security.Cryptography (65)
System.Security.Cryptography.Cose (2)
System.Security.Cryptography.Pkcs (12)
System.Security.Cryptography.Xml (1)
System.Text.Encodings.Web (2)
System.Text.Json (17)
System.Text.RegularExpressions (5)
System.Transactions.Local (2)
System.Web.HttpUtility (4)
System.Windows.Forms (1)
System.Windows.Forms.Design (2)
System.Xaml (3)