140 references to Span
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\RenderBatchWriterTest.cs (1)
279return new Span<byte>(ms.ToArray(), 0, (int)ms.Length);
Microsoft.AspNetCore.DataProtection (6)
Managed\AesGcmAuthenticatedEncryptor.cs (6)
122var nonce = new Span<byte>(ciphertext.Array, nonceOffset, NONCE_SIZE_IN_BYTES); 123var tag = new Span<byte>(ciphertext.Array, tagOffset, TAG_SIZE_IN_BYTES); 124var encrypted = new Span<byte>(ciphertext.Array, encryptedDataOffset, plaintextBytes); 195var nonce = new Span<byte>(retVal, nonceOffset, NONCE_SIZE_IN_BYTES); 196var tag = new Span<byte>(retVal, tagOffset, TAG_SIZE_IN_BYTES); 197var encrypted = new Span<byte>(retVal, encryptedDataOffset, plaintext.Count);
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\Http3\QPack\EncoderStreamReader.cs (2)
257var headerNameSpan = new Span<byte>(_headerName, 0, _headerNameLength); 258var headerValueSpan = new Span<byte>(_headerValueOctets, 0, _headerValueLength);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (6)
BufferWriterTests.cs (6)
51writer.Write(new Span<byte>(array, 0, 0)); 52writer.Write(new Span<byte>(array, array.Length, 0)); 56writer.Write(new Span<byte>(array, offset, length)); 64writer.Write(new Span<byte>(array, 0, array.Length)); 80writer.Write(new Span<byte>(array, offset, length)); 98writer.Write(new Span<byte>(array, 0, array.Length));
Microsoft.AspNetCore.SignalR.Common (1)
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
Microsoft.AspNetCore.WebUtilities (3)
HttpRequestStreamReader.cs (2)
163var span = new Span<char>(buffer, index, count); 396var span = new Span<char>(_charBuffer, _charBufferIndex, _charsRead - _charBufferIndex);
HttpResponseStreamWriter.cs (1)
663var destination = new Span<char>(_charBuffer, _charBufferCount, remaining);
Microsoft.AspNetCore.WebUtilities.Tests (1)
HttpRequestStreamReaderTest.cs (1)
459var res = httpRequestStreamReader.Read(new Span<char>(new char[10], 0, 1));
Microsoft.Build (2)
BackEnd\Client\MSBuildClientPacketPump.cs (1)
269int packetLength = BinaryPrimitives.ReadInt32LittleEndian(new Span<byte>(headerByte, 1, 4));
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
948int packetLength = BinaryPrimitives.ReadInt32LittleEndian(new Span<byte>(_headerByte, 1, 4));
Microsoft.CodeAnalysis.Workspaces (1)
Storage\SQLite\v2\Interop\SqlConnection.cs (1)
346ThrowIfNotOk(NativeMethods.sqlite3_blob_read(blob, new Span<byte>(bytes, start: 0, length), offset: 0));
Microsoft.Extensions.AI.OpenAI (1)
src\Shared\ServerSentEvents\ArrayBuffer.cs (1)
90public readonly Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
Microsoft.Extensions.Caching.Hybrid.Tests (1)
DistributedCacheTests.cs (1)
378public override Span<byte> GetSpan() => new(_data, 5, _data.Length - 10);
Microsoft.Extensions.Logging.Console (1)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
Microsoft.ML.CpuMath.PerformanceTests (22)
AvxPerformanceTests.cs (10)
18=> AvxIntrinsics.AddScalarU(DefaultScale, new Span<float>(dst, 0, Length)); 22=> AvxIntrinsics.Scale(DefaultScale, new Span<float>(dst, 0, Length)); 30=> AvxIntrinsics.ScaleAddU(DefaultScale, DefaultScale, new Span<float>(dst, 0, Length)); 61=> AvxIntrinsics.Sum(new Span<float>(src, 0, Length)); 66=> AvxIntrinsics.SumSqU(new Span<float>(src, 0, Length)); 71=> AvxIntrinsics.SumSqDiffU(DefaultScale, new Span<float>(src, 0, Length)); 75=> AvxIntrinsics.SumAbsU(new Span<float>(src, 0, Length)); 79=> AvxIntrinsics.SumAbsDiffU(DefaultScale, new Span<float>(src, 0, Length)); 83=> AvxIntrinsics.MaxAbsU(new Span<float>(src, 0, Length)); 87=> AvxIntrinsics.MaxAbsDiffU(DefaultScale, new Span<float>(src, 0, Length));
SmallInputCpuMathPerformanceTests.cs (2)
57=> CpuMathUtils.Sum(new Span<float>(src, 0, arrayLength)); 61=> CpuMathUtils.SumSq(new Span<float>(src, 0, arrayLength));
SsePerformanceTests.cs (10)
15=> SseIntrinsics.AddScalarU(DefaultScale, new Span<float>(dst, 0, Length)); 19=> SseIntrinsics.Scale(DefaultScale, new Span<float>(dst, 0, Length)); 27=> SseIntrinsics.ScaleAddU(DefaultScale, DefaultScale, new Span<float>(dst, 0, Length)); 55=> SseIntrinsics.Sum(new Span<float>(src, 0, Length)); 59=> SseIntrinsics.SumSqU(new Span<float>(src, 0, Length)); 63=> SseIntrinsics.SumSqDiffU(DefaultScale, new Span<float>(src, 0, Length)); 67=> SseIntrinsics.SumAbsU(new Span<float>(src, 0, Length)); 71=> SseIntrinsics.SumAbsDiffU(DefaultScale, new Span<float>(src, 0, Length)); 75=> SseIntrinsics.MaxAbsU(new Span<float>(src, 0, Length)); 79=> SseIntrinsics.MaxAbsDiffU(DefaultScale, new Span<float>(src, 0, Length));
Microsoft.ML.Transforms (3)
Expression\BuiltinFunctions.cs (3)
742b.Span.CopyTo(new Span<char>(dst, a.Length, b.Length)); 751b.Span.CopyTo(new Span<char>(dst, a.Length, b.Length)); 752c.Span.CopyTo(new Span<char>(dst, a.Length + b.Length, c.Length));
Shared (1)
ServerSentEvents\ArrayBuffer.cs (1)
90public readonly Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System.Collections.Immutable (4)
System\Collections\Frozen\Int32\Int32FrozenSet.cs (1)
28_hashTable = FrozenHashTable.Create(new Span<int>(entries, 0, count), hashCodesAreUnique: true);
System\Collections\Immutable\ImmutableArray_1.Builder.cs (2)
438items.CopyTo(new Span<T>(_elements, offset, items.Length)); 451var elements = new Span<T>(_elements, offset, items.Length);
System\Collections\Immutable\ImmutableArray_1.cs (1)
1519items.CopyTo(new Span<T>(tmp, index, items.Length));
System.ComponentModel.TypeConverter (1)
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (1)
90Read(new Span<byte>(buffer, offset, count));
System.Console (2)
System\IO\ConsoleStream.cs (1)
34return Read(new Span<byte>(buffer, offset, count));
System\TermInfo.DatabaseFactory.cs (1)
132int bytesRead = RandomAccess.Read(fd, new Span<byte>(data, (int)fileOffset, (int)(termInfoLength - fileOffset)), fileOffset);
System.Formats.Asn1 (2)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (2)
115new Span<byte>(bytes, byteIndex, bytes.Length - byteIndex), 150new Span<char>(chars, charIndex, chars.Length - charIndex),
System.IO.Compression (2)
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (1)
98return Read(new Span<byte>(buffer, offset, count));
System\IO\Compression\DeflateZLib\DeflateStream.cs (1)
274return ReadCore(new Span<byte>(buffer, offset, count));
System.IO.Compression.Brotli (1)
System\IO\Compression\dec\BrotliStream.Decompress.cs (1)
34return Read(new Span<byte>(buffer, offset, count));
System.IO.Packaging (1)
System\IO\Packaging\InterleavedZipPackagePartStream.cs (1)
74=> ReadCore(new Span<byte>(buffer, offset, count));
System.IO.Pipelines (1)
System\IO\Pipelines\PipeReaderStream.cs (1)
55return ReadInternal(new Span<byte>(buffer, offset, count));
System.IO.Pipes (1)
System\IO\Pipes\PipeStream.Unix.cs (1)
44return ReadCore(new Span<byte>(buffer, offset, count));
System.Linq (1)
System\Linq\OrderedEnumerable.cs (1)
500new Span<int>(keys, lo, hi - lo + 1).Sort(comparison);
System.Linq.AsyncEnumerable (2)
System\Linq\OrderBy.cs (2)
383new Span<int>(keys, lo, hi - lo + 1).Sort(!_descending ? 423new Span<int>(keys, lo, hi - lo + 1).Sort(Compare);
System.Memory.Data (2)
src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (2)
95return ReadBuffer(new Span<byte>(buffer, offset, count)); 132Task.FromResult(ReadBuffer(new Span<byte>(buffer, offset, count)));
System.Net.Http (3)
src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (2)
95return ReadBuffer(new Span<byte>(buffer, offset, count)); 132Task.FromResult(ReadBuffer(new Span<byte>(buffer, offset, count)));
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System.Net.Quic (1)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System.Net.Requests (1)
System\Net\HttpWebResponse.cs (1)
398return Read(new Span<byte>(buffer, offset, count));
System.Net.Security (3)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System\Net\Security\SslStream.Protocol.cs (2)
1373payload.CopyTo(new Span<byte>(Payload, 0, Size)); 1398internal Span<byte> AvailableSpan => Payload == null ? Span<byte>.Empty : new Span<byte>(Payload, Size, Available);
System.Net.ServerSentEvents (1)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System.Net.Sockets (3)
System\Net\Sockets\SocketPal.Unix.cs (3)
1288bool completed = TryCompleteReceive(handle, new Span<byte>(buffer, offset, count), socketFlags, out bytesTransferred, out errorCode); 1318if (!TryCompleteReceiveMessageFrom(handle, new Span<byte>(buffer, offset, count), null, socketFlags, socketAddress.Buffer, out socketAddressLen, isIPv4, isIPv6, out bytesTransferred, out socketFlags, out ipPacketInformation, out errorCode)) 1363bool completed = TryCompleteReceiveFrom(handle, new Span<byte>(buffer, offset, count), socketFlags, socketAddress.Span, out socketAddressLen, out bytesTransferred, out socketFlags, out errorCode);
System.Net.WebClient (1)
src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (1)
51buffer.Slice(0, toCopy).CopyTo(new Span<byte>(_currentChunk._buffer, _currentChunk._freeOffset, toCopy));
System.Net.WebSockets (3)
System\Net\WebSockets\ManagedWebSocket.cs (2)
680payloadBuffer.CopyTo(new Span<byte>(_sendBuffer, headerLength, payloadLength)); 689ApplyMask(new Span<byte>(_sendBuffer, headerLength, payloadLength), _sendBuffer, maskOffset.Value, 0);
System\Net\WebSockets\WebSocket.cs (1)
47new Span<byte>(array, 0, r.Count).CopyTo(buffer.Span);
System.Private.CoreLib (27)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (1)
1131ArraySortHelper<T>.Sort(new Span<T>(_items, 0, _size), comparison);
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (1)
306return InternalReadChars(new Span<char>(buffer, index, count));
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (2)
787buffer.Slice(0, bytesToWrite).CopyTo(new Span<byte>(_buffer, _writePos, bytesToWrite)); 1119buffer.Span.CopyTo(new Span<byte>(_buffer, _writePos, buffer.Length));
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (1)
361new Span<byte>(_buffer, _position, n).CopyTo(buffer);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (2)
150return ReadSpan(new Span<byte>(buffer, offset, count), new ArraySegment<byte>(buffer, offset, count)); 374new Span<byte>(_buffer!, _readPos, n).CopyTo(destination.Span);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
207Read(new Span<byte>(buffer, offset, count));
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (3)
357return ReadSpan(new Span<char>(buffer, index, count)); 391new Span<char>(_charBuffer, _charPos, n).CopyTo(buffer.Slice(charsRead)); 1239new Span<char>(_charBuffer, _charPos, n).CopyTo(buffer.Span.Slice(charsRead));
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
792source.Span.Slice(copied, n).CopyTo(new Span<char>(_charBuffer, _charPos, n));
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (2)
107new Span<char>(array, 0, numRead).CopyTo(buffer); 157new Span<char>(array, 0, numRead).CopyTo(buffer);
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (1)
339return ReadCore(new Span<byte>(buffer, offset, count));
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (5)
3714return new Span<T>(array, start, length); 3723return new Span<T>(segment.Array, segment.Offset, segment.Count); 3743return new Span<T>(segment.Array, segment.Offset + start, segment.Count - start); 3779return new Span<T>(segment.Array, segment.Offset + start, length); 3791return new Span<T>(segment.Array, segment.Offset + start, length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (2)
231new Span<T>(source, startIndex, length).CopyTo(new Span<T>((void*)destination, length)); 284new Span<T>((void*)source, length).CopyTo(new Span<T>(destination, startIndex, length));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (1)
222ReadSpan(byteOffset, new Span<T>(array, index, count));
src\libraries\System.Private.CoreLib\src\System\Span.cs (1)
214new Span<T>(segment.Array, segment.Offset, segment.Count);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (2)
852value.CopyTo(startIndex, new Span<char>(m_ChunkChars, m_ChunkLength, length), length); 2523get => new Span<char>(m_ChunkChars, m_ChunkLength, m_ChunkChars.Length - m_ChunkLength);
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (1)
293return Read(new Span<byte>(buffer, offset, count));
System.Private.DataContractSerialization (2)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (1)
172Read(new Span<byte>(buffer, offset, count));
System\Xml\EncodingStreamWrapper.cs (1)
585Read(new Span<byte>(buffer, offset, count));
System.Reflection.Metadata (1)
System\Reflection\Internal\Utilities\BlobUtilities.cs (1)
18new Span<byte>(buffer, start, byteCount).Fill(value);
System.Security.Cryptography (12)
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (1)
95destination = new Span<byte>(buf, 0, rsaSize);
src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (3)
350dbMaskSpan = new Span<byte>(dbMask, 0, db.Length); 422Span<byte> dbMask = new Span<byte>(dbMaskRented, 0, dbLen); 520Span<byte> dbMask = new Span<byte>(dbMaskRented, 0, maskedDb.Length);
System\Security\Cryptography\CryptoStream.cs (5)
362CryptographicOperations.ZeroMemory(new Span<byte>(_inputBuffer, 0, _inputBufferIndex)); 396CryptographicOperations.ZeroMemory(new Span<byte>(tempOutputBuffer, 0, numOutputBytes)); 417CryptographicOperations.ZeroMemory(new Span<byte>(tempInputBuffer, 0, numWholeBlocksInBytes)); 611CryptographicOperations.ZeroMemory(new Span<byte>(tempOutputBuffer, 0, numOutputBytes)); 617CryptographicOperations.ZeroMemory(new Span<byte>(tempOutputBuffer, 0, numOutputBytes));
System\Security\Cryptography\PemKeyHelpers.cs (2)
43Span<byte> writtenSpan = new Span<byte>(buffer, 0, bytesWritten); 79Span<byte> writtenSpan = new Span<byte>(buffer, 0, bytesWritten);
System\Security\Cryptography\RandomNumberGeneratorImplementation.cs (1)
37GetBytes(new Span<byte>(data, offset, count));
System.Security.Cryptography.Pkcs (3)
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyTrans.cs (1)
209return new Span<byte>(cek, 0, cekLength).ToArray();
System\Security\Cryptography\Pkcs\CmsSignature.DSA.cs (1)
81Span<byte> ieee = new Span<byte>(rented, 0, bufSize);
System\Security\Cryptography\Pkcs\CmsSignature.ECDsa.cs (1)
85Span<byte> ieee = new Span<byte>(rented, 0, bufSize);
System.Text.Json (4)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
89public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (1)
87new Span<byte>(pooledName, 0, written).Clear();
System\Text\Json\Serialization\ReadBufferState.cs (2)
144new Span<byte>(oldBuffer, 0, oldMaxCount).Clear(); 181new Span<byte>(_buffer, 0, _maxCount).Clear();
System.Windows.Forms (1)
System\Windows\Forms\ActiveX\DataStreamFromComStream.cs (1)
59Span<byte> span = new(buffer, index, count);