347 references to AsSpan
http2cat (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (2)
448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
IIS.FunctionalTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (2)
448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
IIS.LongTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (2)
448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
IIS.NewHandler.FunctionalTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (2)
448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
IIS.NewShim.FunctionalTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (2)
448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
IISExpress.FunctionalTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (2)
448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
InMemory.FunctionalTests (5)
Http2\Http2StreamTests.cs (5)
3553headersFrame2.PayloadSequence.CopyTo(temp.AsSpan((int)headersFrame.PayloadSequence.Length)); 3590headersFrame2.PayloadSequence.CopyTo(temp.AsSpan((int)headersFrame.PayloadSequence.Length)); 3639frames[i].PayloadSequence.CopyTo(temp.AsSpan(destinationIndex)); 3703headersFrame2.PayloadSequence.CopyTo(temp.AsSpan((int)headersFrame.PayloadSequence.Length)); 3740headersFrame2.PayloadSequence.CopyTo(temp.AsSpan((int)headersFrame.PayloadSequence.Length));
Microsoft.AspNetCore.Components (2)
ParameterView.cs (1)
126_frames.AsSpan(1, numEntries).CopyTo(cloneBuffer.AsSpan(1));
src\Components\Shared\src\ArrayBuilder.cs (1)
99source.CopyTo(_items.AsSpan(_itemsInUse));
Microsoft.AspNetCore.Components.Forms (2)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (2)
64_currentBuffer[_nextEndIndex..].CopyTo(newBuffer.AsSpan(newEndIndex)); 66span.CopyTo(newBuffer.AsSpan(newEndIndex));
Microsoft.AspNetCore.Components.Server (6)
src\Components\Shared\src\ArrayBuilder.cs (1)
99source.CopyTo(_items.AsSpan(_itemsInUse));
src\Shared\PooledArrayBufferWriter.cs (1)
139return _rentedBuffer.AsSpan(_index);
src\SignalR\common\Shared\MemoryBufferWriter.cs (3)
236segment.Span.CopyTo(result.AsSpan(totalWritten)); 242_currentSegment.AsSpan(0, _position).CopyTo(result.AsSpan(totalWritten)); 317if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan(_position)))
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (1)
1113initializedChars += decoder.GetChars(this.reader.UnreadSpan.Slice(0, bytesRead), charArray.AsSpan(initializedChars), flush);
Microsoft.AspNetCore.Components.Web (2)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (2)
64_currentBuffer[_nextEndIndex..].CopyTo(newBuffer.AsSpan(newEndIndex)); 66span.CopyTo(newBuffer.AsSpan(newEndIndex));
Microsoft.AspNetCore.Components.WebView (1)
src\Components\Shared\src\ArrayBuilder.cs (1)
99source.CopyTo(_items.AsSpan(_itemsInUse));
Microsoft.AspNetCore.DataProtection.Abstractions (1)
src\Shared\WebEncoders\WebEncoders.cs (1)
310return Base64UrlEncode(input.AsSpan(offset, count), output.AsSpan(outputOffset));
Microsoft.AspNetCore.Diagnostics.Middleware (1)
src\Shared\BufferWriterPool\BufferWriter.cs (1)
161return _buffer.AsSpan(WrittenCount);
Microsoft.AspNetCore.Http.Connections (4)
src\Shared\WebEncoders\WebEncoders.cs (1)
310return Base64UrlEncode(input.AsSpan(offset, count), output.AsSpan(outputOffset));
src\SignalR\common\Shared\MemoryBufferWriter.cs (3)
236segment.Span.CopyTo(result.AsSpan(totalWritten)); 242_currentSegment.AsSpan(0, _position).CopyTo(result.AsSpan(totalWritten)); 317if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan(_position)))
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
src\Shared\PooledArrayBufferWriter.cs (1)
139return _rentedBuffer.AsSpan(_index);
Microsoft.AspNetCore.OpenApi (3)
src\SignalR\common\Shared\MemoryBufferWriter.cs (3)
236segment.Span.CopyTo(result.AsSpan(totalWritten)); 242_currentSegment.AsSpan(0, _position).CopyTo(result.AsSpan(totalWritten)); 317if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan(_position)))
Microsoft.AspNetCore.OutputCaching (1)
RecyclableArrayBufferWriter.cs (1)
74return _buffer.AsSpan(_index);
Microsoft.AspNetCore.Server.HttpSys (1)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
104_requestMemoryBlob.GetUnknownKeys(destination.AsSpan(knownHeadersCount));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (2)
448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
Microsoft.AspNetCore.Server.IIS (1)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
104_requestMemoryBlob.GetUnknownKeys(destination.AsSpan(knownHeadersCount));
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Internal\Http\DateHeaderValueManager.cs (1)
49Encoding.ASCII.GetBytes(dateValue, dateBytes.AsSpan(DatePreambleBytes.Length));
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (2)
448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
310data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 394data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
HttpParserBenchmark.cs (1)
26next.SetOwnedMemory(RequestParsingData.UnicodeRequest.AsSpan(split).ToArray());
Microsoft.AspNetCore.Shared.Tests (6)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
104_requestMemoryBlob.GetUnknownKeys(destination.AsSpan(knownHeadersCount));
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (2)
448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
310data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 394data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
src\Shared\WebEncoders\WebEncoders.cs (1)
310return Base64UrlEncode(input.AsSpan(offset, count), output.AsSpan(outputOffset));
Microsoft.AspNetCore.SignalR.Client.Tests (3)
src\SignalR\common\Shared\MemoryBufferWriter.cs (3)
236segment.Span.CopyTo(result.AsSpan(totalWritten)); 242_currentSegment.AsSpan(0, _position).CopyTo(result.AsSpan(totalWritten)); 317if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan(_position)))
Microsoft.AspNetCore.SignalR.Common (3)
src\SignalR\common\Shared\MemoryBufferWriter.cs (3)
236segment.Span.CopyTo(result.AsSpan(totalWritten)); 242_currentSegment.AsSpan(0, _position).CopyTo(result.AsSpan(totalWritten)); 317if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan(_position)))
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (3)
src\SignalR\common\Shared\MemoryBufferWriter.cs (3)
236segment.Span.CopyTo(result.AsSpan(totalWritten)); 242_currentSegment.AsSpan(0, _position).CopyTo(result.AsSpan(totalWritten)); 317if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan(_position)))
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (3)
src\SignalR\common\Shared\MemoryBufferWriter.cs (3)
236segment.Span.CopyTo(result.AsSpan(totalWritten)); 242_currentSegment.AsSpan(0, _position).CopyTo(result.AsSpan(totalWritten)); 317if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan(_position)))
Microsoft.AspNetCore.SignalR.Specification.Tests (3)
src\SignalR\common\Shared\MemoryBufferWriter.cs (3)
236segment.Span.CopyTo(result.AsSpan(totalWritten)); 242_currentSegment.AsSpan(0, _position).CopyTo(result.AsSpan(totalWritten)); 317if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan(_position)))
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
src\SignalR\common\Shared\MemoryBufferWriter.cs (3)
236segment.Span.CopyTo(result.AsSpan(totalWritten)); 242_currentSegment.AsSpan(0, _position).CopyTo(result.AsSpan(totalWritten)); 317if (_currentSegment != null && span.TryCopyTo(_currentSegment.AsSpan(_position)))
Microsoft.AspNetCore.WebUtilities (2)
MultipartBoundary.cs (1)
35public ReadOnlySpan<byte> BoundaryBytes => _boundaryBytes.AsSpan(_expectLeadingCrlf ? 0 : 2);
src\Shared\WebEncoders\WebEncoders.cs (1)
310return Base64UrlEncode(input.AsSpan(offset, count), output.AsSpan(outputOffset));
Microsoft.CodeAnalysis.CSharp (1)
Utilities\InterceptableLocation.cs (1)
150var position = BinaryPrimitives.ReadInt32LittleEndian(bytes.AsSpan(start: positionIndex));
Microsoft.DotNet.Build.Tasks.Installers (9)
src\RpmHeader.cs (9)
252BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(4), (int)entry.Type); 255BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(8), (int)storeStream.Length); 260BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(12), binary.Count); 268BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(8), (int)storeStream.Length); 269BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(12), 1); 278BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(8), (int)storeStream.Length); 282BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(12), strings.Length); 304BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(8), (int)storeStream.Length); 308BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(12), contents.Length);
Microsoft.Extensions.AI.Abstractions (1)
Contents\DataContent.cs (1)
159wrote |= Convert.TryToBase64Chars(data.Span, array.AsSpan(prefixLength), out int dataLength);
Microsoft.Extensions.AI.OpenAI (2)
src\Shared\ServerSentEvents\ArrayBuffer.cs (1)
95public readonly Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\Shared\ServerSentEvents\SseParser_1.cs (1)
419fieldValue.CopyTo(_dataBuffer.AsSpan(_dataLength));
Microsoft.Extensions.Caching.Hybrid (1)
Internal\RecyclableArrayBufferWriter.cs (1)
128return _buffer.AsSpan(_index);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
src\Shared\BufferWriterPool\BufferWriter.cs (1)
161return _buffer.AsSpan(WrittenCount);
Microsoft.Extensions.Http.Diagnostics (1)
src\Shared\BufferWriterPool\BufferWriter.cs (1)
161return _buffer.AsSpan(WrittenCount);
Microsoft.Extensions.Logging.Console (1)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
Microsoft.JSInterop (1)
src\Components\Shared\src\ArrayBuilder.cs (1)
99source.CopyTo(_items.AsSpan(_itemsInUse));
Microsoft.ML.Core (3)
Utilities\BigArray.cs (3)
339src.CopyTo(_entries[maMax].AsSpan(miMin)); 346src.Slice(0, firstSubArrayCapacity).CopyTo(_entries[maMin].AsSpan(miMin)); 358src.Slice(0, srcSoFar).CopyTo(_entries[maMin].AsSpan(miMin));
Microsoft.ML.CpuMath (2)
AlignedArray.cs (2)
129src.CopyTo(Items.AsSpan(_base)); 135src.CopyTo(Items.AsSpan(start + _base));
Microsoft.ML.Data (2)
Deprecated\Vector\VectorUtils.cs (2)
313return CpuMathUtils.DotProductDense(a.AsSpan(offset), bValues, b.Length); 314return CpuMathUtils.DotProductSparse(a.AsSpan(offset), bValues, b.GetIndices(), bValues.Length);
Microsoft.ML.FastTree (16)
Utils\ToByteArrayExtensions.cs (16)
55MemoryMarshal.Write(buffer.AsSpan(position), ref a); 77MemoryMarshal.Write(buffer.AsSpan(position), ref a); 99MemoryMarshal.Write(buffer.AsSpan(position), ref a); 121MemoryMarshal.Write(buffer.AsSpan(position), ref a); 143MemoryMarshal.Write(buffer.AsSpan(position), ref a); 165MemoryMarshal.Write(buffer.AsSpan(position), ref a); 187MemoryMarshal.Write(buffer.AsSpan(position), ref a); 209MemoryMarshal.Write(buffer.AsSpan(position), ref a); 293MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 326MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 359MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 397MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 430MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 463MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 496MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 529MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position));
Microsoft.ML.Mkl.Components (3)
SymSgdClassificationTrainer.cs (1)
466instArray.CopyTo(_storage[_storageIndex].Buffer.AsSpan(_indexInCurArray));
VectorWhitening.cs (2)
702editor.Values[i] = CpuMathUtils.DotProductSparse(model.AsSpan(offs), values, indices, count); 712return CpuMathUtils.DotProductSparse(a.AsSpan(aOffset), b, indices, count);
Microsoft.ML.Tokenizers (7)
Model\SentencePieceUnigramModel.cs (5)
150normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).CopyTo(utf16NormalizedString.AsSpan(utf16NormalizedString.Length - normalizedStringCountFromEnd)); 155text.CopyTo(normalizedString.AsSpan(normalizedString.Length - normalizedStringCountFromEnd - text.Length)); 167normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).CopyTo(utf16NormalizedString.AsSpan(utf16NormalizedString.Length - normalizedStringCountFromEnd)); 172bool res = Helpers.ConvertUtf8ToUtf16(utf8Bytes, normalizedString.AsSpan(normalizedString.Length - normalizedStringCountFromEnd - expectedCount), out int bytesConsumed, out int charsWritten); 1288normalizedText = normalizedString is not null ? normalizedString.AsSpan(normalizedString.Length - normalizedStringCountFromEnd).ToString() : null;
Normalizer\BertNormalizer.cs (1)
168chars.CopyTo(buffer.AsSpan(index));
Utils\Helpers.netcoreapp.cs (1)
92buffer.Slice(0, bytesWritten).CopyTo(destination.AsSpan(bytesIndex));
Microsoft.ML.TorchSharp (6)
Utils\DataUtils.cs (6)
81s2.CopyTo(array.AsSpan(s1.Length)); 89s2.CopyTo(array.AsSpan(s1.Length)); 90s3.CopyTo(array.AsSpan(s1.Length + s2.Length)); 98array.AsSpan(s1.Length)[0] = s2; 106array.AsSpan(s1.Length)[0] = s2; 107array.AsSpan(s1.Length + 1)[0] = s3;
Shared (4)
BufferWriterPool\BufferWriter.cs (1)
161return _buffer.AsSpan(WrittenCount);
ServerSentEvents\ArrayBuffer.cs (1)
95public readonly Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
ServerSentEvents\SseParser_1.cs (2)
419fieldValue.CopyTo(_dataBuffer.AsSpan(_dataLength)); 497_lineBuffer.AsSpan(offset));
System.Collections (1)
System\Collections\BitArray.cs (1)
790Span<byte> span = byteArray.AsSpan(index);
System.Collections.Immutable (2)
System\Collections\Frozen\FrozenDictionary.cs (1)
377CopyTo(destination.AsSpan(destinationIndex));
System\Collections\Frozen\FrozenSet.cs (1)
275CopyTo(destination.AsSpan(destinationIndex));
System.Console (3)
System\IO\StdInReader.cs (1)
84chars.CopyTo(_unprocessedBufferToBeRead.AsSpan(_endIndex));
System\TermInfo.Database.cs (2)
291=> BinaryPrimitives.ReadInt32LittleEndian(buffer.AsSpan(pos)); 306int i = buffer.AsSpan(pos).IndexOf((byte)'\0');
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\Metrics\TagList.netcore.cs (2)
163CopyTo(array.AsSpan(arrayIndex)); 195_overflowTags.AsSpan(index, _tagsCount - index).CopyTo(_overflowTags.AsSpan(index + 1));
System.Formats.Asn1 (14)
System\Formats\Asn1\AsnWriter.BitString.cs (3)
93bitString.CopyTo(_buffer.AsSpan(_offset)); 173dest = _buffer.AsSpan(_offset); 186dest = _buffer.AsSpan(_offset);
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (1)
121Span<byte> baseSpan = _buffer.AsSpan(_offset);
System\Formats\Asn1\AsnWriter.Integer.cs (3)
246value.CopyTo(_buffer.AsSpan(_offset)); 274value.CopyTo(_buffer.AsSpan(_offset)); 287value.TryWriteBytes(_buffer.AsSpan(_offset), out int bytesWritten, isBigEndian: true);
System\Formats\Asn1\AsnWriter.OctetString.cs (3)
98octetString.CopyTo(_buffer.AsSpan(_offset)); 150dest = _buffer.AsSpan(_offset); 159dest = _buffer.AsSpan(_offset);
System\Formats\Asn1\AsnWriter.Oid.cs (3)
66wellKnownContents.CopyTo(_buffer.AsSpan(_offset)); 125int localLen = EncodeSubIdentifier(tmp.AsSpan(tmpOffset), ref subIdentifier); 131localLen = EncodeSubIdentifier(tmp.AsSpan(tmpOffset), ref subIdentifier);
System\Formats\Asn1\AsnWriter.UtcTime.cs (1)
98Span<byte> baseSpan = _buffer.AsSpan(_offset);
System.Formats.Cbor (9)
System\Formats\Cbor\Writer\CborWriter.cs (1)
147encodedValue.CopyTo(_buffer.AsSpan(_offset));
System\Formats\Cbor\Writer\CborWriter.Integer.cs (3)
102BinaryPrimitives.WriteUInt16BigEndian(_buffer.AsSpan(_offset), (ushort)value); 109BinaryPrimitives.WriteUInt32BigEndian(_buffer.AsSpan(_offset), (uint)value); 116BinaryPrimitives.WriteUInt64BigEndian(_buffer.AsSpan(_offset), value);
System\Formats\Cbor\Writer\CborWriter.Simple.cs (2)
66CborHelpers.WriteSingleBigEndian(_buffer.AsSpan(_offset), value); 75CborHelpers.WriteDoubleBigEndian(_buffer.AsSpan(_offset), value);
System\Formats\Cbor\Writer\CborWriter.Simple.netcoreapp.cs (2)
26BinaryPrimitives.WriteUInt16BigEndian(_buffer.AsSpan(_offset), PositiveQNaNBitsHalf); 30BinaryPrimitives.WriteHalfBigEndian(_buffer.AsSpan(_offset), value);
System\Formats\Cbor\Writer\CborWriter.String.cs (1)
53value.CopyTo(_buffer.AsSpan(_offset));
System.Formats.Nrbf (1)
System\Formats\Nrbf\Utils\TypeNameHelpers.cs (1)
213libraryName.AsSpan().CopyTo(rented.AsSpan(typeName.Length + 1));
System.IO.FileSystem.Watcher (4)
System\IO\FileSystemWatcher.cs (4)
763items.AsSpan(index).CopyTo(newItems.AsSpan(index + 1)); 779items.AsSpan(index + 1).CopyTo(newItems.AsSpan(index));
System.IO.Hashing (4)
System\IO\Hashing\XxHash32.cs (2)
99source.Slice(0, remain).CopyTo(_holdback.AsSpan(held)); 107source.CopyTo(_holdback.AsSpan(held));
System\IO\Hashing\XxHash64.cs (2)
99source.Slice(0, remain).CopyTo(_holdback.AsSpan(held)); 107source.CopyTo(_holdback.AsSpan(held));
System.Linq (1)
System\Linq\Concat.SpeedOpt.cs (1)
71builder.ToSpan(result.AsSpan(firstCount));
System.Memory (1)
src\libraries\Common\src\System\Buffers\ArrayBufferWriter.cs (1)
196return _buffer.AsSpan(_index);
System.Net.Http (19)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (2)
448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (2)
310data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 394data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex));
System\Net\Http\HttpContent.cs (3)
911buffer.CopyTo(lastBuffer.AsSpan(offset)); 969buffer.CopyTo(newBuffer.AsSpan(_totalLength)); 997Span<byte> remainingInCurrentBuffer = _lastBuffer.AsSpan(_lastBufferOffset);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
187Encoding.ASCII.GetBytes(hostHeader, hostHeaderLine.AsSpan(6));
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (10)
122byte usernameLength = EncodeString(credentials.UserName, buffer.AsSpan(2), nameof(credentials.UserName)); 124byte passwordLength = EncodeString(credentials.Password, buffer.AsSpan(3 + usernameLength), nameof(credentials.Password)); 161hostIP.TryWriteBytes(buffer.AsSpan(4), out int bytesWritten); 169hostIP.TryWriteBytes(buffer.AsSpan(4), out int bytesWritten); 177byte hostLength = EncodeString(host, buffer.AsSpan(5), nameof(host)); 182BinaryPrimitives.WriteUInt16BigEndian(buffer.AsSpan(addressLength + 4), (ushort)port); 227BinaryPrimitives.WriteUInt16BigEndian(buffer.AsSpan(2), (ushort)port); 278ipv4Address.TryWriteBytes(buffer.AsSpan(4), out int bytesWritten); 282byte usernameLength = EncodeString(credentials?.UserName, buffer.AsSpan(8), nameof(credentials.UserName)); 289byte hostLength = EncodeString(host, buffer.AsSpan(totalLength), nameof(host));
System.Net.Mail (3)
System\Net\BufferBuilder.cs (1)
40value.CopyTo(_buffer.AsSpan(_offset));
System\Net\BufferedReadStream.cs (1)
130buffer.CopyTo(_storedBuffer.AsSpan(_storedOffset));
System\Net\Mime\WriteStateInfoBase.cs (1)
83bytes.CopyTo(_buffer.AsSpan(Length));
System.Net.NetworkInformation (1)
System\Net\NetworkInformation\PhysicalAddress.cs (1)
32hash ^= BinaryPrimitives.ReadInt32LittleEndian(_address.AsSpan(i));
System.Net.Ping (4)
System\Net\NetworkInformation\Ping.RawSocket.cs (4)
148IcmpHeader receivedHeader = MemoryMarshal.Read<IcmpHeader>(receiveBuffer.AsSpan(icmpHeaderOffset)); 183IcmpHeader originalRequestHeader = MemoryMarshal.Read<IcmpHeader>(receiveBuffer.AsSpan(dataOffset + payloadIpHeaderLength)); 216IcmpHeader originalRequestHeader = MemoryMarshal.Read<IcmpHeader>(receiveBuffer.AsSpan(dataOffset + IpV6HeaderLengthInBytes)); 474ushort checksum = ComputeBufferChecksum(result.AsSpan(offset));
System.Net.Quic (1)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
System.Net.Security (4)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (3)
520BinaryPrimitives.WriteUInt16LittleEndian(targetInfoBuffer.AsSpan(2 + targetInfoOffset), (ushort)spnSize); 523int bytesWritten = Encoding.Unicode.GetBytes(_spn, targetInfoBuffer.AsSpan(4 + targetInfoOffset)); 548return targetInfoBuffer.AsSpan(targetInfoOffset).ToArray();
System.Net.ServerSentEvents (3)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
System\Net\ServerSentEvents\SseParser_1.cs (2)
401fieldValue.CopyTo(_dataBuffer.AsSpan(_dataLength)); 479_lineBuffer.AsSpan(offset));
System.Net.WebClient (2)
System\Net\WebClient.cs (2)
514"--\r\n"u8.CopyTo(boundaryBytes.AsSpan("\r\n--".Length + boundary.Length)); 515OperationStatus conversionStatus = Ascii.FromUtf16(boundary, boundaryBytes.AsSpan("\r\n--".Length), out _);
System.Net.WebSockets (5)
System\Net\WebSockets\Compression\WebSocketDeflater.cs (1)
54DeflatePrivate(payload, _buffer.AsSpan(position), endOfMessage,
System\Net\WebSockets\Compression\WebSocketInflater.cs (2)
57public Span<byte> Span => _buffer.AsSpan(_position + _available); 117FlushMarker.CopyTo(_buffer.AsSpan(_available));
System\Net\WebSockets\ManagedWebSocket.cs (2)
743BinaryPrimitives.WriteUInt16BigEndian(sendBuffer.AsSpan(2), (ushort)payload.Length); 749BinaryPrimitives.WriteUInt64BigEndian(sendBuffer.AsSpan(2), (ulong)payload.Length);
System.Private.CoreLib (38)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (2)
110source.CopyTo(list._items.AsSpan(list._size)); 153source.CopyTo(list._items.AsSpan(index));
src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
2414ToBase64CharsLargeNoLineBreaks(new ReadOnlySpan<byte>(inArray, offsetIn, length), outArray.AsSpan(offsetOut), charLengthRequired);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
1595int encoded = encoder.GetBytes(toEncode.Span, bytes.AsSpan(preambleSize), flush: contents.IsEmpty);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (7)
501source.CopyTo(_buffer!.AsSpan(_writePos)); 507source.Slice(0, numBytes).CopyTo(_buffer!.AsSpan(_writePos)); 548source.CopyTo(_buffer.AsSpan(_writePos)); 638buffer.Span.CopyTo(_buffer.AsSpan(_writePos)); 702source.Span.CopyTo(_buffer.AsSpan(_writePos)); 708source.Span.Slice(0, spaceLeft).CopyTo(_buffer.AsSpan(_writePos)); 732source.Span.CopyTo(_buffer.AsSpan(_writePos));
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (1)
969charBuffer.AsSpan(charPos, charLen - charPos).CopyTo(arrayPoolBuffer.AsSpan(arrayPoolBufferPos));
src\libraries\System.Private.CoreLib\src\System\Numerics\IBinaryInteger.cs (4)
70if (!TSelf.TryReadBigEndian(source.AsSpan(startIndex), isUnsigned, out TSelf value)) 113if (!TSelf.TryReadLittleEndian(source.AsSpan(startIndex), isUnsigned, out TSelf value)) 221if (!TryWriteBigEndian(destination.AsSpan(startIndex), out int bytesWritten)) 258if (!TryWriteLittleEndian(destination.AsSpan(startIndex), out int bytesWritten))
src\libraries\System.Private.CoreLib\src\System\Numerics\IFloatingPoint.cs (4)
131if (!TryWriteExponentBigEndian(destination.AsSpan(startIndex), out int bytesWritten)) 168if (!TryWriteExponentLittleEndian(destination.AsSpan(startIndex), out int bytesWritten)) 205if (!TryWriteSignificandBigEndian(destination.AsSpan(startIndex), out int bytesWritten)) 242if (!TryWriteSignificandLittleEndian(destination.AsSpan(startIndex), out int bytesWritten))
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\ISimdVector_2.cs (2)
194static virtual void CopyTo(TSelf vector, T[] destination, int startIndex) => TSelf.CopyTo(vector, destination.AsSpan(startIndex)); 244static virtual TSelf Create(T[] values, int index) => TSelf.Create(values.AsSpan(index));
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (3)
2314new ReadOnlySpan<char>(ref value, firstLength).CopyTo(m_ChunkChars.AsSpan(m_ChunkLength)); 2477new ReadOnlySpan<char>(ref value, lengthToCopy).CopyTo(chunk.m_ChunkChars.AsSpan(indexInChunk)); 2794new ReadOnlySpan<char>(endChunk.m_ChunkChars, endIndexInChunk, copyCount).CopyTo(endChunk.m_ChunkChars.AsSpan(copyTargetIndexInChunk));
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (2)
1120=> BinaryPrimitives.ReadInt32BigEndian(value.AsSpan(startIndex)); 1130=> BinaryPrimitives.ReadInt64BigEndian(value.AsSpan(startIndex));
src\System\Reflection\Emit\RuntimeILGenerator.cs (8)
123BinaryPrimitives.WriteInt16BigEndian(m_ILStream.AsSpan(m_length), opcodeValue); 226BinaryPrimitives.WriteInt32LittleEndian(newBytes.AsSpan(fixupData.m_fixupPos), updateAddr); 269BinaryPrimitives.WriteInt32LittleEndian(m_ILStream.AsSpan(m_length), value); 393BinaryPrimitives.WriteInt16LittleEndian(m_ILStream.AsSpan(m_length), arg); 732BinaryPrimitives.WriteInt64LittleEndian(m_ILStream.AsSpan(m_length), arg); 740BinaryPrimitives.WriteInt32LittleEndian(m_ILStream.AsSpan(m_length), BitConverter.SingleToInt32Bits(arg)); 748BinaryPrimitives.WriteInt64LittleEndian(m_ILStream.AsSpan(m_length), BitConverter.DoubleToInt64Bits(arg)); 892BinaryPrimitives.WriteInt16LittleEndian(m_ILStream.AsSpan(m_length), (short)tempVal);
src\System\Reflection\Emit\SignatureHelper.cs (2)
477BinaryPrimitives.WriteInt16BigEndian(m_signature.AsSpan(m_currSig), (short)(data | 0x80_00)); 482BinaryPrimitives.WriteInt32BigEndian(m_signature.AsSpan(m_currSig), (int)(data | 0xC0_00_00_00));
src\System\RuntimeType.CoreCLR.cs (1)
3798return parameters.AsSpan(1).ToArray();
System.Private.DataContractSerialization (5)
System\Runtime\Serialization\DataContract.cs (1)
1843b = unchecked(a + f + sines[j] + BinaryPrimitives.ReadUInt32LittleEndian(block.AsSpan(g)));
System\Text\BinHexEncoding.cs (1)
81HexConverter.EncodeToUtf16(bytes.AsSpan(byteIndex, byteCount), chars.AsSpan(charIndex));
System\Xml\XmlStreamNodeWriter.cs (3)
282value.CopyTo(buffer.AsSpan(offset)); 341.CopyTo(MemoryMarshal.Cast<byte, char>(buffer.AsSpan(offset))); 346MemoryMarshal.Cast<byte, short>(buffer.AsSpan(offset)));
System.Private.Uri (1)
System\UriHelper.cs (1)
329vsb.AsSpan(destPosition).TryCopyTo(dest.AsSpan(destPosition));
System.Private.Xml (48)
System\Xml\BinaryXml\SqlUtils.cs (1)
73=> BinaryPrimitives.ReadUInt32LittleEndian(data.AsSpan(offset));
System\Xml\BinaryXml\XmlBinaryReader.cs (8)
4375private short GetInt16(int pos) => BinaryPrimitives.ReadInt16LittleEndian(_data.AsSpan(pos)); 4377private ushort GetUInt16(int pos) => BinaryPrimitives.ReadUInt16LittleEndian(_data.AsSpan(pos)); 4379private int GetInt32(int pos) => BinaryPrimitives.ReadInt32LittleEndian(_data.AsSpan(pos)); 4381private uint GetUInt32(int pos) => BinaryPrimitives.ReadUInt32LittleEndian(_data.AsSpan(pos)); 4383private long GetInt64(int pos) => BinaryPrimitives.ReadInt64LittleEndian(_data.AsSpan(pos)); 4385private ulong GetUInt64(int pos) => BinaryPrimitives.ReadUInt64LittleEndian(_data.AsSpan(pos)); 4387private float GetSingle(int offset) => BinaryPrimitives.ReadSingleLittleEndian(_data.AsSpan(offset)); 4389private double GetDouble(int offset) => BinaryPrimitives.ReadDoubleLittleEndian(_data.AsSpan(offset));
System\Xml\Core\XmlTextReaderImpl.cs (19)
2886int read = stream.ReadAtLeast(_ps.bytes.AsSpan(_ps.bytesUsed), bytesToRead, throwOnEndOfStream: false); 3594if (!_ps.chars.AsSpan(_ps.charPos).StartsWith(XmlDeclarationBeginning) || 3784if (_ps.chars.AsSpan(_ps.charPos).StartsWith("1.0")) 3946if (chars.AsSpan(pos).StartsWith("CDATA[")) 4166if (chars.AsSpan(pos).StartsWith("CDATA[")) 4373if (prefixLen == _lastPrefix.Length && chars.AsSpan(startPos).StartsWith(_lastPrefix)) 4549if (!chars.AsSpan(_ps.charPos).StartsWith(startTagNode.localName)) 4558if (!chars.AsSpan(_ps.charPos).StartsWith(startTagNode.prefix) || 4560!chars.AsSpan(colonPos + 1).StartsWith(startTagNode.localName)) 6681if (!_ps.chars.AsSpan(_ps.charPos).StartsWith("DOCTYPE")) 6763if (!_ps.chars.AsSpan(_ps.charPos).StartsWith("PUBLIC")) 6800if (!_ps.chars.AsSpan(_ps.charPos).StartsWith("SYSTEM")) 7674if (prefixLen == _lastPrefix.Length && _ps.chars.AsSpan(_ps.charPos).StartsWith(_lastPrefix)) 8223Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 2).StartsWith("?>")); 8231Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("-->")); 8239Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("]]>")); 8359if (chars.AsSpan(pos + 2).StartsWith("[CDATA[")) 8379if ((endPos - _ps.charPos - 2) == checkName.Length && chars.AsSpan(_ps.charPos + 2).StartsWith(checkName) && 8418if (endPos - _ps.charPos - 1 == _curNode.localName.Length && _ps.chars.AsSpan(_ps.charPos + 1).StartsWith(_curNode.localName) &&
System\Xml\Core\XmlTextReaderImplAsync.cs (11)
1179if (!_ps.chars.AsSpan(_ps.charPos).StartsWith(XmlDeclarationBeginning) || 1366if (_ps.chars.AsSpan(_ps.charPos).StartsWith("1.0")) 1517if (chars.AsSpan(pos).StartsWith("CDATA[")) 1771if (chars.AsSpan(pos).StartsWith("CDATA[")) 1966if (prefixLen == _lastPrefix.Length && chars.AsSpan(startPos).StartsWith(_lastPrefix)) 2108if (!chars.AsSpan(_ps.charPos).StartsWith(startTagNode.localName)) 2117if (!chars.AsSpan(_ps.charPos).StartsWith(startTagNode.prefix) || 2119!chars.AsSpan(colonPos + 1).StartsWith(startTagNode.localName)) 4424if (!_ps.chars.AsSpan(_ps.charPos).StartsWith("DOCTYPE")) 4508if (!_ps.chars.AsSpan(_ps.charPos).StartsWith("PUBLIC")) 4545if (!_ps.chars.AsSpan(_ps.charPos).StartsWith("SYSTEM"))
System\Xml\Schema\DtdParser.cs (3)
1987if (_chars.AsSpan(_curPos + 1).StartsWith("PCDATA")) 3118if (!_chars.AsSpan(_curPos + 1).StartsWith("UBLIC")) 3137if (!_chars.AsSpan(_curPos + 1).StartsWith("YSTEM"))
System\Xml\Schema\DtdParserAsync.cs (4)
1585if (_chars.AsSpan(_curPos + 1).StartsWith("PCDATA")) 2169if (_chars.AsSpan(_curPos + 1).StartsWith("DATA")) 2531if (!_chars.AsSpan(_curPos + 1).StartsWith("UBLIC")) 2550if (!_chars.AsSpan(_curPos + 1).StartsWith("YSTEM"))
System\Xml\XmlEncoding.cs (2)
521code = BinaryPrimitives.ReadUInt32LittleEndian(bytes.AsSpan(i)); 562code = BinaryPrimitives.ReadUInt32BigEndian(bytes.AsSpan(i));
System.Reflection.Metadata (3)
System\Reflection\Internal\Utilities\BlobUtilities.cs (1)
80bool written = value.TryWriteBytes(buffer.AsSpan(start));
System\Reflection\Metadata\BlobBuilder.cs (1)
676buffer.Slice(0, bytesToCurrent).CopyTo(_buffer.AsSpan(Length));
System\Reflection\Metadata\BlobWriter.cs (1)
153buffer.CopyTo(_buffer.AsSpan(start));
System.Security.Cryptography (12)
src\libraries\Common\src\System\Security\Cryptography\EccKeyFormatHelper.cs (1)
762writer.WriteOctetString(fieldElement.AsSpan(start));
src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (1)
35span.CopyTo(target.AsSpan(length - span.Length));
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (1)
437lastBlock.AsSpan().CopyTo(destination.AsSpan(written));
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (2)
687_decryptBuffer.AsSpan(saveOffset)); 859decrypted.AsSpan().CopyTo(_keyDecryptBuffer.AsSpan(_keyDecryptBufferOffset));
System\Security\Cryptography\Base64Transforms.cs (1)
177ConvertFromBase64(transformBuffer, outputBuffer.AsSpan(outputOffset), out _, out int written);
System\Security\Cryptography\CryptoStream.cs (1)
321_outputBuffer.AsSpan(bytesToCopy).CopyTo(_outputBuffer);
System\Security\Cryptography\OpenSslCipherLite.cs (1)
72Span<byte> outputSpan = rented.AsSpan(written);
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
289BinaryPrimitives.WriteUInt32BigEndian(_salt.AsSpan(_salt.Length - sizeof(uint)), _block + 1);
System\Security\Cryptography\UniversalCryptoTransform.cs (1)
114return UncheckedTransformBlock(inputBuffer.AsSpan(inputOffset, inputCount), outputBuffer.AsSpan(outputOffset));
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
1068serialNumber.CopyTo(newSerialNumber.AsSpan(1));
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (1)
1395_errors.AsSpan(toReturn.Length).Clear();
System.Security.Cryptography.Cose (4)
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (3)
405CoseHelpers.WriteHeaderMap(buffer.AsSpan(protectedMapBytesWritten), writer, unprotectedHeaders, isProtected: false, null); 477int signProtectedBytesWritten = CoseHelpers.WriteHeaderMap(buffer.AsSpan(start), writer, signer._protectedHeaders, isProtected: true, signer._algHeaderValueToSlip); 479CoseHelpers.WriteHeaderMap(buffer.AsSpan(start + signProtectedBytesWritten), writer, signer.UnprotectedHeaders, isProtected: false, null);
System\Security\Cryptography\Cose\CoseSign1Message.cs (1)
338CoseHelpers.WriteHeaderMap(buffer.AsSpan(protectedMapBytesWritten), writer, signer._unprotectedHeaders, isProtected: false, null);
System.Security.Cryptography.Pkcs (2)
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (1)
437lastBlock.AsSpan().CopyTo(destination.AsSpan(written));
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (1)
273nonceSpan.CopyTo(temp.AsSpan(1));
System.Text.Json (10)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
94public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (6)
229MemoryMarshal.Write(_data.AsSpan(Length), ref row); 278Span<byte> destination = _data.AsSpan(index + SizeOrLengthOffset); 287Span<byte> dataPos = _data.AsSpan(index + NumberOfRowsOffset); 300Span<byte> dataPos = _data.AsSpan(index + SizeOrLengthOffset); 335return MemoryMarshal.Read<DbRow>(_data.AsSpan(index)); 341uint union = MemoryMarshal.Read<uint>(_data.AsSpan(index + NumberOfRowsOffset));
System\Text\Json\Document\JsonDocument.StackRowStack.cs (2)
50MemoryMarshal.Write(_rentedBuffer.AsSpan(_topOfStack), ref row); 58StackRow row = MemoryMarshal.Read<StackRow>(_rentedBuffer.AsSpan(_topOfStack));
System\Text\Json\Serialization\ReadBufferState.cs (1)
100_buffer.AsSpan(_count));
System.Windows.Forms (1)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiSelectRootGridEntry.PropertyMerger.cs (1)
49List<PropertyDescriptor[]>? properties = GetCommonProperties(objects.AsSpan(1), presort: true, tab, parentEntry);
System.Xaml (1)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (1)
1505public override void CopyTo(T[] array, int index) => _entries.AsSpan(0, _count).CopyTo(array.AsSpan(index));