381 instantiations of Span
InMemory.FunctionalTests (3)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (3)
73return new Span<T>(AllocAsPointer<T>(count), count); 128return new Span<byte>(Alloc(sizeHint), sizeHint); 138return new Span<byte>(_currentBlock, _currentBlockCount);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
UserJwtsTests.cs (1)
597var buffer = new Span<byte>(new byte[key.Length]);
Microsoft.AspNetCore.Components.Server (1)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReaderExtensions.cs (1)
76Span<byte> tempSpan = new Span<byte>(&buffer, sizeof(T));
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\RenderBatchWriterTest.cs (1)
279return new Span<byte>(ms.ToArray(), 0, (int)ms.Length);
Microsoft.AspNetCore.DataProtection (7)
KeyManagement\KeyRingBasedDataProtector.cs (1)
295var span = new Span<byte>(ptr, sizeof(Guid));
Managed\AesGcmAuthenticatedEncryptor.cs (6)
124var nonce = new Span<byte>(ciphertext.Array, nonceOffset, NONCE_SIZE_IN_BYTES); 125var tag = new Span<byte>(ciphertext.Array, tagOffset, TAG_SIZE_IN_BYTES); 126var encrypted = new Span<byte>(ciphertext.Array, encryptedDataOffset, plaintextBytes); 197var nonce = new Span<byte>(retVal, nonceOffset, NONCE_SIZE_IN_BYTES); 198var tag = new Span<byte>(retVal, tagOffset, TAG_SIZE_IN_BYTES); 199var encrypted = new Span<byte>(retVal, encryptedDataOffset, plaintext.Count);
Microsoft.AspNetCore.Http.Connections.Common (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
118_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.OpenApi (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
118_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.Server.HttpSys (7)
RequestProcessing\Response.cs (3)
534unknownHeaders = new Span<HTTP_UNKNOWN_HEADER>(unknownAlloc, numUnknownHeaders); 565knownHeaderInfo = new Span<HTTP_RESPONSE_INFO>(responseAlloc, numKnownMultiHeaders); 579var nativeHeaderValues = new Span<HTTP_KNOWN_HEADER>(headerAlloc, headerValues.Count);
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (3)
73return new Span<T>(AllocAsPointer<T>(count), count); 128return new Span<byte>(Alloc(sizeHint), sizeHint); 138return new Span<byte>(_currentBlock, _currentBlockCount);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
833return new Span<T>(_pointer, _length);
Microsoft.AspNetCore.Server.IIS (5)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (3)
73return new Span<T>(AllocAsPointer<T>(count), count); 128return new Span<byte>(Alloc(sizeHint), sizeHint); 138return new Span<byte>(_currentBlock, _currentBlockCount);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
278return new Span<byte>(NativeRequest->pRawUrl, NativeRequest->RawUrlLength); 833return new Span<T>(_pointer, _length);
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 (24)
AsciiDecoding.cs (5)
28var span = new Span<byte>(byteArray); 65Assert.Throws<InvalidOperationException>(() => new Span<byte>(byteRange).GetAsciiStringNonNullCharacters()); 76var span = new Span<byte>(expectedByteRange); 98var span = new Span<byte>(expectedByteRange); 126var span = new Span<byte>(byteArray);
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));
PathNormalizerTests.cs (1)
60var length = PathNormalizer.RemoveDotSegments(new Span<byte>(data));
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (3)
73return new Span<T>(AllocAsPointer<T>(count), count); 128return new Span<byte>(Alloc(sizeHint), sizeHint); 138return new Span<byte>(_currentBlock, _currentBlockCount);
src\Shared\test\Shared.Tests\runtime\Http3\VariableLengthIntegerHelperTests.cs (8)
252Span<byte> span = new Span<byte>(); 267Span<byte> span = new Span<byte>(new byte[1]); 283Span<byte> span = new Span<byte>(new byte[2]); 296Span<byte> span = new Span<byte>(new byte[1]); 311Span<byte> span = new Span<byte>(new byte[4]); 324Span<byte> span = new Span<byte>(new byte[1]); 339Span<byte> span = new Span<byte>(new byte[8]); 352Span<byte> span = new Span<byte>(new byte[1]);
VariableIntHelperTests.cs (1)
25var outputBuffer = new Span<byte>(new byte[8]);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (9)
Mocks\NullParser.cs (6)
26handler.OnHeader(new Span<byte>(_hostHeaderName), new Span<byte>(_hostHeaderValue)); 27handler.OnHeader(new Span<byte>(_acceptHeaderName), new Span<byte>(_acceptHeaderValue)); 28handler.OnHeader(new Span<byte>(_connectionHeaderName), new Span<byte>(_connectionHeaderValue));
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (3)
73return new Span<T>(AllocAsPointer<T>(count), count); 128return new Span<byte>(Alloc(sizeHint), sizeHint); 138return new Span<byte>(_currentBlock, _currentBlockCount);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (3)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (3)
73return new Span<T>(AllocAsPointer<T>(count), count); 128return new Span<byte>(Alloc(sizeHint), sizeHint); 138return new Span<byte>(_currentBlock, _currentBlockCount);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (3)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (3)
73return new Span<T>(AllocAsPointer<T>(count), count); 128return new Span<byte>(Alloc(sizeHint), sizeHint); 138return new Span<byte>(_currentBlock, _currentBlockCount);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (3)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (3)
73return new Span<T>(AllocAsPointer<T>(count), count); 128return new Span<byte>(Alloc(sizeHint), sizeHint); 138return new Span<byte>(_currentBlock, _currentBlockCount);
Microsoft.AspNetCore.Shared.Tests (11)
PathNormalizerTests.cs (1)
59var length = PathNormalizer.RemoveDotSegments(new Span<byte>(data));
runtime\Http3\VariableLengthIntegerHelperTests.cs (8)
252Span<byte> span = new Span<byte>(); 267Span<byte> span = new Span<byte>(new byte[1]); 283Span<byte> span = new Span<byte>(new byte[2]); 296Span<byte> span = new Span<byte>(new byte[1]); 311Span<byte> span = new Span<byte>(new byte[4]); 324Span<byte> span = new Span<byte>(new byte[1]); 339Span<byte> span = new Span<byte>(new byte[8]); 352Span<byte> span = new Span<byte>(new byte[1]);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
278return new Span<byte>(NativeRequest->pRawUrl, NativeRequest->RawUrlLength); 833return new Span<T>(_pointer, _length);
Microsoft.AspNetCore.SignalR.Common (2)
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
118_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
118_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
118_encoder.Convert(new Span<char>(&value, 1), destination, false, out charsUsed, out bytesUsed, out _);
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 (3)
HttpRequestStreamReaderTest.cs (3)
272var span = new Span<char>(chars); 291var span = new Span<char>(chars); 459var res = httpRequestStreamReader.Read(new Span<char>(new char[10], 0, 1));
Microsoft.Build (2)
BackEnd\Client\MSBuildClientPacketPump.cs (1)
256int packetLength = BinaryPrimitives.ReadInt32LittleEndian(new Span<byte>(headerByte, 1, 4));
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
664int packetLength = BinaryPrimitives.ReadInt32LittleEndian(new Span<byte>(_headerByte, 1, 4));
Microsoft.Extensions.Caching.Hybrid.Tests (1)
DistributedCacheTests.cs (1)
366public override Span<byte> GetSpan() => new(_data, 5, _data.Length - 10);
PresentationCore (1)
System\Windows\Media\StreamAsIStream.cs (1)
602var span = new Span<byte>(buffer.ToPointer(), (int) cb);
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)
89Read(new Span<byte>(buffer, offset, count));
System.Console (3)
System\IO\ConsoleStream.cs (2)
34return Read(new Span<byte>(buffer, offset, count)); 40int result = Read(new Span<byte>(ref b));
System\TermInfo.DatabaseFactory.cs (1)
132int bytesRead = RandomAccess.Read(fd, new Span<byte>(data, (int)fileOffset, (int)(termInfoLength - fileOffset)), fileOffset);
System.Data.Common (1)
System\Data\SQLTypes\SQLBytes.cs (1)
199Read(offset, new Span<byte>(ref b));
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Activity.cs (1)
1985ActivityTraceId.SetToRandomBytes(new Span<byte>(&id, sizeof(ulong)));
System.Diagnostics.Process (2)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (1)
70int bytesWritten = Encoding.UTF8.GetBytes(str, new Span<byte>(arrPtr[i], byteLength));
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
31_bytes = new Span<byte>(_arrayToReturnToPool);
System.Formats.Asn1 (4)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (4)
115new Span<byte>(bytes, byteIndex, bytes.Length - byteIndex), 123new Span<byte>(bytes, byteCount), 150new Span<char>(chars, charIndex, chars.Length - charIndex), 158new Span<char>(chars, charCount),
System.Formats.Cbor (1)
src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
23return new Span<T>(_pointer, _length);
System.Formats.Tar (1)
System\Formats\Tar\SubReadStream.cs (1)
131return Read(new Span<byte>(ref b)) == 1 ? b : -1;
System.IO.Compression (6)
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (2)
98return Read(new Span<byte>(buffer, offset, count)); 146return Read(new Span<byte>(ref b)) == 1 ? b : -1;
System\IO\Compression\DeflateZLib\DeflateStream.cs (3)
239return ReadCore(new Span<byte>(buffer, offset, count)); 1002int bytesRead = _deflateStream._inflater.Inflate(new Span<byte>(_arrayPoolBuffer)); 1038int bytesRead = _deflateStream._inflater.Inflate(new Span<byte>(_arrayPoolBuffer));
System\IO\Compression\ZipCustomStreams.cs (1)
332return Read(new Span<byte>(ref b)) == 1 ? b : -1;
System.IO.Compression.Brotli (4)
System\IO\Compression\dec\BrotliStream.Decompress.cs (2)
34return Read(new Span<byte>(buffer, offset, count)); 47int bytesRead = Read(new Span<byte>(ref b));
System\IO\Compression\enc\BrotliStream.Compress.cs (2)
69Span<byte> output = new Span<byte>(_buffer); 177Span<byte> output = new Span<byte>(_buffer);
System.IO.Hashing (9)
System\IO\Hashing\XxHashShared.cs (9)
117Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 168DefaultSecret.CopyTo(new Span<byte>(secret, SecretLengthBytes)); 251source.CopyTo(new Span<byte>(buffer + state.BufferedCount, source.Length)); 266source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 305source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 318source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 322Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex); 381new ReadOnlySpan<byte>(buffer + InternalBufferLengthBytes - catchupSize, catchupSize).CopyTo(new Span<byte>(lastStripe, StripeLengthBytes)); 382new ReadOnlySpan<byte>(buffer, (int)state.BufferedCount).CopyTo(new Span<byte>(lastStripe + catchupSize, (int)state.BufferedCount));
System.IO.Pipelines (1)
System\IO\Pipelines\PipeReaderStream.cs (1)
55return ReadInternal(new Span<byte>(buffer, offset, count));
System.IO.Pipes (2)
System\IO\Pipes\PipeStream.cs (1)
116return Read(new Span<byte>(&b, 1)) > 0 ? b : -1;
System\IO\Pipes\PipeStream.Unix.cs (1)
44return ReadCore(new Span<byte>(buffer, offset, count));
System.Linq (1)
System\Linq\OrderedEnumerable.cs (1)
502new Span<int>(keys, lo, hi - lo + 1).Sort(comparison);
System.Memory (1)
System\Buffers\SequenceReaderExtensions.Binary.cs (1)
43Span<byte> tempSpan = new Span<byte>(&buffer, sizeof(T));
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 (7)
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)
83public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System\Net\Http\Headers\HttpHeaders.cs (1)
1115values = new Span<string?>(ref singleValue);
System\Net\Http\HttpBaseStream.cs (1)
42return Read(new Span<byte>(ref b)) == 1 ? b : -1;
System\Net\Http\HttpContent.cs (1)
1019buffer.CopyTo(new Span<byte>(_buffer, _length, buffer.Length));
System\Net\Http\MultipartContent.cs (1)
487return Read(new Span<byte>(ref b)) == 1 ? b : -1;
System.Net.NameResolution (2)
src\libraries\Common\src\System\Net\InteropIPAddressExtensions.Unix.cs (1)
15ipAddress.TryWriteBytes(new Span<byte>(nativeIPAddress.Address, Interop.Sys.IPv6AddressBytes), out int bytesWritten);
System\Net\NameResolutionPal.Unix.cs (1)
165addr.TryWriteBytes(new Span<byte>(rawAddress, rawAddressLength), out int bytesWritten);
System.Net.Ping (2)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
31_bytes = new Span<byte>(_arrayToReturnToPool);
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
446new Span<byte>(&ipHeader, sizeof(IpHeader)).CopyTo(result);
System.Net.Primitives (3)
System\Net\IPNetwork.cs (3)
113BaseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref baseAddressValue)), out int bytesWritten); 115address.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref otherAddressValue)), out bytesWritten); 221baseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref value)), out int bytesWritten);
System.Net.Quic (10)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
83public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System\Net\Quic\Internal\MsQuicHelpers.cs (1)
41Span<byte> addressBytes = new Span<byte>(quicAddress, SocketAddressPal.IPv6AddressSize);
System\Net\Quic\Internal\MsQuicTlsSecret.cs (5)
59? new Span<byte>(_tlsSecrets->ClientHandshakeTrafficSecret, _tlsSecrets->SecretLength) 63? new Span<byte>(_tlsSecrets->ServerHandshakeTrafficSecret, _tlsSecrets->SecretLength) 67? new Span<byte>(_tlsSecrets->ClientTrafficSecret0, _tlsSecrets->SecretLength) 71? new Span<byte>(_tlsSecrets->ServerTrafficSecret0, _tlsSecrets->SecretLength) 75? new Span<byte>(_tlsSecrets->ClientEarlyTrafficSecret, _tlsSecrets->SecretLength)
System\Net\Quic\Interop\msquic.cs (1)
23public readonly Span<byte> Span => new(Buffer, (int)Length);
System\Net\Quic\QuicConnection.cs (1)
526_negotiatedApplicationProtocol = new SslApplicationProtocol(new Span<byte>(data.NegotiatedAlpn, data.NegotiatedAlpnLength).ToArray());
System\Net\Quic\QuicStream.Stream.cs (1)
110return Read(new Span<byte>(ref b)) != 0 ? b : -1;
System.Net.Requests (1)
System\Net\HttpWebResponse.cs (1)
397return Read(new Span<byte>(buffer, offset, count));
System.Net.Security (10)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (1)
668var clientList = new Span<byte>(inp, (int)inlen);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
83public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (3)
341Span<byte> span = MemoryMarshal.AsBytes(new Span<MessageField>(ref field)); 446md5.AppendData(new Span<byte>((void*)cbtData, cbtDataSize)); 620Span<byte> responseAsSpan = new Span<byte>(responseBytes);
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (1)
41cbtPrefix.CopyTo(new Span<byte>((byte*)cbtPrefixPtr, cbtPrefix.Length));
System\Net\Security\SslStream.cs (2)
766int bytesRead = Read(new Span<byte>(ref oneByte)); 976return new Span<byte>(_pointer, _length);
System\Net\Security\SslStream.Protocol.cs (2)
1368payload.CopyTo(new Span<byte>(Payload, 0, Size)); 1393internal Span<byte> AvailableSpan => Payload == null ? Span<byte>.Empty : new Span<byte>(Payload, Size, Available);
System.Net.Sockets (9)
src\libraries\Common\src\System\Net\InteropIPAddressExtensions.Unix.cs (1)
15ipAddress.TryWriteBytes(new Span<byte>(nativeIPAddress.Address, Interop.Sys.IPv6AddressBytes), out int bytesWritten);
System\Net\Sockets\NetworkStream.cs (1)
264return Read(new Span<byte>(&b, 1)) == 0 ? -1 : b;
System\Net\Sockets\SocketAsyncContext.Unix.cs (2)
547bool completed = SocketPal.TryCompleteReceiveFrom(context._socket, new Span<byte>(BufferPtr, Length), null, Flags, SocketAddress.Span, out int socketAddressLen, out BytesTransferred, out ReceivedFlags, out ErrorCode); 604bool completed = SocketPal.TryCompleteReceiveMessageFrom(context._socket, new Span<byte>(BufferPtr, Length), null, Flags, SocketAddress!, out int socketAddressLen, IsIPv4, IsIPv6, out BytesTransferred, out ReceivedFlags, out IPPacketInformation, out ErrorCode);
System\Net\Sockets\SocketPal.Unix.cs (5)
761received = SysReceive(socket, flags | SocketFlags.Peek, new Span<byte>(&oneBytePeekBuffer, 1), out errno); 829received = SysReceive(socket, flags | SocketFlags.Peek, new Span<byte>(&oneBytePeekBuffer, 1), socketAddress, out receivedSocketAddressLength, out receivedFlags, out errno); 1255bool completed = TryCompleteReceive(handle, new Span<byte>(buffer, offset, count), socketFlags, out bytesTransferred, out errorCode); 1285if (!TryCompleteReceiveMessageFrom(handle, new Span<byte>(buffer, offset, count), null, socketFlags, socketAddress.Buffer, out socketAddressLen, isIPv4, isIPv6, out bytesTransferred, out socketFlags, out ipPacketInformation, out errorCode)) 1330bool 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 (4)
System\Net\WebSockets\Compression\WebSocketInflater.cs (1)
218if (Inflate(stream, new Span<byte>(&b, 1), FlushCode.SyncFlush) == 0)
System\Net\WebSockets\ManagedWebSocket.cs (2)
569payloadBuffer.CopyTo(new Span<byte>(_sendBuffer, headerLength, payloadLength)); 578ApplyMask(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 (149)
src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
64return GetAndTrimString(new Span<char>((char*)nativeMsgPtr, length));
src\libraries\Common\src\System\Number.NumberBuffer.cs (2)
34public readonly Span<byte> Digits => new Span<byte>(DigitsPtr, DigitsLength); 36public NumberBuffer(NumberBufferKind kind, byte* digits, int digitsLength) : this(kind, new Span<byte>(digits, digitsLength))
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
31_bytes = new Span<byte>(_arrayToReturnToPool);
src\libraries\System.Private.CoreLib\src\System\Array.cs (8)
1101new Span<T>(array).Fill(value); 1132new Span<T>(ref first, count).Fill(value); 2130var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2179var span = new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), length); 2203var spanKeys = new Span<TKey>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(keys), index), length); 2204var spanItems = new Span<TValue>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(items), index), length); 2221var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2692new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (1)
808var dst = new Span<char>(ref result.GetRawStringData(), result.Length);
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\Convert.cs (1)
2362ToBase64CharsLargeNoLineBreaks(bytes, new Span<char>(ref result.GetRawStringData(), result.Length), result.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.cs (1)
120Span<EventPipeProviderConfigurationNative> providersNative = new Span<EventPipeProviderConfigurationNative>((void*)Marshal.AllocCoTaskMem(sizeof(EventPipeProviderConfigurationNative) * providers.Length), providers.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (1)
489Span<object?> dataRefObj = new Span<object?>(ref eightObjectStack._arg0, EtwAPIMaxRefObjCount);
src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
1951WriteMultipleFoundFlagsNames(names, foundItems, new Span<char>(ref result.GetRawStringData(), result.Length));
src\libraries\System.Private.CoreLib\src\System\Exception.cs (1)
152Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (6)
933TryFormatS(dateTime, new Span<char>(ref str.GetRawStringData(), str.Length), out int charsWritten); 940TryFormatInvariantG(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out int charsWritten); 959TryFormatInvariantG(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out int charsWritten); 985TryFormatR(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out charsWritten); 992TryFormatS(dateTime, new Span<char>(ref str.GetRawStringData(), str.Length), out charsWritten); 999TryFormatu(dateTime, offset, new Span<char>(ref str.GetRawStringData(), str.Length), out charsWritten);
src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (2)
57var destination = new Span<char>(ref result.GetRawStringData(), result.Length); 103var destination = new Span<char>(ref result.GetRawStringData(), result.Length);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (3)
331Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 350Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 382s.AsSpan(0, i).CopyTo(new Span<char>(pResult, result.Length));
src\libraries\System.Private.CoreLib\src\System\Guid.cs (3)
440Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 526Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 1171bool result = TryFormatCore(new Span<char>(ref guidString.GetRawStringData(), guidString.Length), out int bytesWritten, format);
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (3)
163charsRead = _decoder.GetChars(charBytes[..numBytes], new Span<char>(ref singleChar), flush: false); 306return InternalReadChars(new Span<char>(buffer, index, count)); 404int n = InternalReadChars(new Span<char>(chars));
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\Enumeration\FileSystemEnumerator.Unix.cs (1)
115ref entry, _entry, _currentPath, _rootDirectory, _originalRootDirectory, new Span<char>(_pathBuffer));
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 (2)
203return Read(new Span<byte>(ref b)) != 0 ? b : -1; 207Read(new Span<byte>(buffer, offset, count));
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (3)
359return ReadSpan(new Span<char>(buffer, index, count)); 393new Span<char>(_charBuffer, _charPos, n).CopyTo(buffer.Slice(charsRead)); 1241new Span<char>(_charBuffer, _charPos, n).CopyTo(buffer.Span.Slice(charsRead));
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
794source.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\TextWriter.cs (2)
166buffer.CopyTo(new Span<char>(array)); 370buffer.CopyTo(new Span<char>(array));
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\Memory.cs (1)
350return new Span<T>(ref refToReturn, lengthOfUnderlyingSpan);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (9)
40return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)start /* force zero-extension */), array.Length - start); 64return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)actualIndex /* force zero-extension */), array.Length - actualIndex); 88return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)start /* force zero-extension */), length); 2639return new Span<T>(array); 2657return new Span<T>(array, start, length); 2666return new Span<T>(segment.Array, segment.Offset, segment.Count); 2686return new Span<T>(segment.Array, segment.Offset + start, segment.Count - start); 2722return new Span<T>(segment.Array, segment.Offset + start, length); 2734return new Span<T>(segment.Array, segment.Offset + start, length);
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (14)
325var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 353var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 919var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 978var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1033var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1090var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1149var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1210var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1265var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1322var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1383var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1444var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize)); 1501var vlb = new ValueListBuilder<char>(new Span<char>(stackPtr, CharStackBufferSize)); 1558var vlb = new ValueListBuilder<TChar>(new Span<TChar>(stackPtr, CharStackBufferSize));
src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
299Shuffle(new Span<T>(ref MemoryMarshal.GetArrayDataReference(values), values.Length));
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (6)
78Span<object?> copyOfArgs = new(ref copyOfArg); 81Span<bool> shouldCopyBack = new(ref copyBack); 211shouldCopyBack = new Span<bool>(pArgStorage + _argCount, _argCount); 248shouldCopyBack = new Span<bool>(pStorage + _argCount * 2, _argCount); 298Span<object?> copyOfArgs = new(ref copyOfArg, 1); 301Span<bool> shouldCopyBack = new(ref copyBack, 1); // Not used for setters
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (1)
38span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(items), size);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (9)
233new Span<T>(source, startIndex, length).CopyTo(new Span<T>((void*)destination, length)); 286new Span<T>((void*)source, length).CopyTo(new Span<T>(destination, startIndex, length)); 959s.CopyTo(new Span<char>((char*)ptr, s.Length)); 977int nbWritten = Encoding.UTF8.GetBytes(s, new Span<byte>(pbMem, nb)); 1000s.CopyTo(new Span<char>((char*)ptr, s.Length)); 1018int nbWritten = Encoding.UTF8.GetBytes(s, new Span<byte>(pbMem, nb)); 1230s.CopyTo(new Span<char>((char*)bstr, s.Length)); // AllocBSTR already included the null terminator
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
39int convertedBytes = Encoding.UTF8.GetBytes(s, new Span<byte>(buffer, bufferLength));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\AnsiStringMarshaller.cs (2)
28Span<byte> buffer = new(mem, exactByteCount); 85buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (2)
61=> new Span<TUnmanagedElement>(unmanaged, numElements); 150_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
99managed.CopyTo(new Span<char>(ptrToFirstChar, managed.Length));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (1)
84public Span<T> AsSpan() => new(_data, _numElements);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (2)
62=> new Span<TUnmanagedElement>(unmanaged, numElements); 151_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (1)
71=> new Span<TUnmanagedElement>(unmanaged, numElements);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (2)
66=> new Span<TUnmanagedElement>(unmanaged, numElements); 149_span = new Span<TUnmanagedElement>(_allocatedMemory, managed.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (2)
29Span<byte> buffer = new(mem, exactByteCount); 89buffer = new Span<byte>((byte*)NativeMemory.Alloc((nuint)exactByteCount), exactByteCount);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (1)
154return new Span<TTo>(
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (1)
225ReadSpan(byteOffset, new Span<T>(array, index, count));
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
90int charsWritten = Ordinal.ToUpperOrdinal(value, new Span<char>(ref upperCase.GetRawStringData(), upperCase.Length));
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (7)
290return new Span<char>((byte*)buffer.DangerousGetHandle(), (int)(buffer.ByteLength / 2)); 323span.Slice(0, length).CopyTo(new Span<char>((void*)ptr, length)); 334new Span<char>((void*)ptr, length).Clear(); 379Span<char> resultSpan = new Span<char>((void*)ptr, byteLength / sizeof(char)); 385Marshal.GetAnsiStringBytes(span, new Span<byte>((void*)ptr, byteLength)); 397new Span<byte>((void*)ptr, byteLength).Clear(); 464new Span<byte>((void*)handle, _byteLength).Clear();
src\libraries\System.Private.CoreLib\src\System\Span.cs (2)
211public static implicit operator Span<T>(T[]? array) => new Span<T>(array); 217new Span<T>(segment.Array, segment.Offset, segment.Count);
src\libraries\System.Private.CoreLib\src\System\String.cs (1)
340action(new Span<char>(ref result.GetRawStringData(), length), state);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (7)
281Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 298Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 320Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 345Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 1122new Span<char>(ref result._firstChar, count).Fill(paddingChar); 1141new Span<char>(ref Unsafe.Add(ref result._firstChar, oldLength), count).Fill(paddingChar); 1418Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length);
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (1)
210bytes.CopyTo(MemoryMarshal.AsBytes(new Span<int>(ref _leftoverBytes)));
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (2)
722new ReadOnlySpan<byte>(arrByte, 0, byteCount).CopyTo(new Span<byte>(bytes, byteCount)); 871new ReadOnlySpan<char>(arrChar, 0, charCount).CopyTo(new Span<char>(chars, charCount));
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (4)
500bytes: new Span<byte>(pOriginalBytes, originalByteCount).Slice(bytesWrittenSoFar), 532Span<byte> bytes = new Span<byte>(pOriginalBytes, originalByteCount).Slice(bytesWrittenSoFar); 1096chars: new Span<char>(pOriginalChars, originalCharCount).Slice(charsWrittenSoFar), 1134Span<char> chars = new Span<char>(pOriginalChars, originalCharCount).Slice(charsWrittenSoFar);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (4)
372CopyTo(startIndex, new Span<char>(ref result.GetRawStringData(), result.Length), result.Length); 851value.CopyTo(startIndex, new Span<char>(m_ChunkChars, m_ChunkLength, length), length); 880CopyTo(sourceIndex, new Span<char>(destination).Slice(destinationIndex), count); 2522get => new Span<char>(m_ChunkChars, m_ChunkLength, m_ChunkChars.Length - m_ChunkLength);
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
293return Read(new Span<byte>(buffer, offset, count)); 443return Read(new Span<byte>(ref b)) != 0 ? b : -1;
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (1)
71return new Span<byte>(ref *pDestination, bytesWritten).ToArray(); // this overload of Span ctor doesn't validate length
src\System\Reflection\Emit\DynamicILGenerator.cs (3)
909m_code = new Span<byte>(code, codeSize).ToArray(); 926m_exceptions = new Span<byte>(exceptions, exceptionsSize).ToArray(); 941m_localSignature = new Span<byte>(localSignature, signatureSize).ToArray();
src\System\RuntimeType.CoreCLR.cs (1)
654new Span<bool>(overrides, numVirtuals).Clear();
src\System\StubHelpers.cs (1)
444Span<char> native = new Span<char>((char*)nativeHome, length);
src\System\Text\StringBuilder.CoreCLR.cs (2)
36new Span<char>(newBuffer, newLength).CopyTo(m_ChunkChars); 107CopyTo(0, new Span<char>((char*)dest, charLen), charLen);
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (2)
172Read(new Span<byte>(buffer, offset, count)); 231if (Read(new Span<byte>(ref b)) == 0)
System\Xml\EncodingStreamWrapper.cs (1)
585Read(new Span<byte>(buffer, offset, count));
System.Private.Xml (1)
System\Xml\Core\XmlUtf8RawTextWriter.cs (1)
117bom.CopyTo(new Span<byte>(_bufBytes).Slice(1));
System.Reflection.Metadata (4)
System\Reflection\Internal\Utilities\BlobUtilities.cs (1)
18new Span<byte>(buffer, start, byteCount).Fill(value);
System\Reflection\Internal\Utilities\ReadOnlyUnmanagedMemoryStream.cs (1)
45new Span<byte>(_data + _position, bytesRead).CopyTo(buffer);
System\Reflection\Internal\Utilities\StreamExtensions.netcoreapp.cs (1)
11=> stream.Read(new Span<byte>(buffer, size));
System\Reflection\PortableExecutable\PEReader.EmbeddedPortablePdb.cs (1)
103actualLength = deflate.TryReadAll(new Span<byte>(decompressed.Pointer, decompressed.Size));
System.Runtime.Numerics (2)
src\libraries\Common\src\System\Number.NumberBuffer.cs (2)
34public readonly Span<byte> Digits => new Span<byte>(DigitsPtr, DigitsLength); 36public NumberBuffer(NumberBufferKind kind, byte* digits, int digitsLength) : this(kind, new Span<byte>(digits, digitsLength))
System.Security.Cryptography (24)
Microsoft\Win32\SafeHandles\SafePasswordHandle.cs (1)
52Span<char> dest = new Span<char>((void*)handle, spanLen);
src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
23return new Span<T>(_pointer, _length);
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanOpenSsl.Derive.cs (1)
166secret = new Span<byte>(rented, 0, secretLength);
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (1)
97destination = new Span<byte>(buf, 0, rsaSize);
src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (3)
350dbMaskSpan = new Span<byte>(dbMask, 0, db.Length); 421Span<byte> dbMask = new Span<byte>(dbMaskRented, 0, dbLen); 518Span<byte> dbMask = new Span<byte>(dbMaskRented, 0, maskedDb.Length);
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
31_bytes = new Span<byte>(_arrayToReturnToPool);
System\Security\Cryptography\AsymmetricAlgorithm.cs (2)
798Span<byte> writtenSpan = new Span<byte>(buf, 0, bytesWritten); 828Span<byte> writtenSpan = new Span<byte>(buf, 0, bytesWritten);
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\FixedMemoryKeyBox.cs (2)
15key.CopyTo(new Span<byte>(memory, key.Length)); 24CryptographicOperations.ZeroMemory(new Span<byte>((void*)handle, _length));
System\Security\Cryptography\HKDF.cs (1)
135var counterSpan = new Span<byte>(ref counter);
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\RandomNumberGenerator.cs (1)
129Span<byte> oneUintBytes = MemoryMarshal.AsBytes(new Span<uint>(ref oneUint));
System\Security\Cryptography\RandomNumberGeneratorImplementation.cs (2)
31GetBytes(new Span<byte>(data)); 37GetBytes(new Span<byte>(data, offset, count));
System\Security\Cryptography\X509Certificates\UnixPkcs12Reader.cs (1)
50Span<byte> tmpSpan = new Span<byte>((byte*)tmpPtr, encodedData.Length);
System.Security.Cryptography.Cose (1)
src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
23return new Span<T>(_pointer, _length);
System.Text.Encoding.CodePages (1)
System\Text\BaseCodePageEncoding.netcoreapp.cs (1)
53Span<byte> pCodePageIndex = new Span<byte>(&codePageIndex, sizeof(CodePageIndex));
System.Text.Encodings.Web (2)
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (1)
69Span<uint> thisAllowedCharactersBitmap = new Span<uint>(pBitmap, BitmapLengthInDWords);
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (1)
86Span<char> destination = new Span<char>(buffer, bufferLength);
System.Text.Json (3)
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (1)
87new Span<byte>(pooledName, 0, written).Clear();
System\Text\Json\Serialization\ReadBufferState.cs (2)
128new Span<byte>(oldBuffer, 0, oldMaxCount).Clear(); 165new Span<byte>(_buffer, 0, _maxCount).Clear();
5054 references to Span
http2cat (57)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (15)
181var buffer = _headerEncodingBuffer.AsSpan(); 249var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 282var buffer = _headerEncodingBuffer.AsSpan(); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 322var buffer = _headerEncodingBuffer.AsSpan(); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 326var payload = buffer.Slice(extendedHeaderLength); 366var buffer = _headerEncodingBuffer.AsSpan(); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 416internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 728var payload = new byte[priorityFrame.PayloadLength].AsSpan();
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
IIS.FunctionalTests (57)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (15)
181var buffer = _headerEncodingBuffer.AsSpan(); 249var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 282var buffer = _headerEncodingBuffer.AsSpan(); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 322var buffer = _headerEncodingBuffer.AsSpan(); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 326var payload = buffer.Slice(extendedHeaderLength); 366var buffer = _headerEncodingBuffer.AsSpan(); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 416internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 728var payload = new byte[priorityFrame.PayloadLength].AsSpan();
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
IIS.LongTests (57)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (15)
181var buffer = _headerEncodingBuffer.AsSpan(); 249var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 282var buffer = _headerEncodingBuffer.AsSpan(); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 322var buffer = _headerEncodingBuffer.AsSpan(); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 326var payload = buffer.Slice(extendedHeaderLength); 366var buffer = _headerEncodingBuffer.AsSpan(); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 416internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 728var payload = new byte[priorityFrame.PayloadLength].AsSpan();
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
IIS.NewHandler.FunctionalTests (57)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (15)
181var buffer = _headerEncodingBuffer.AsSpan(); 249var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 282var buffer = _headerEncodingBuffer.AsSpan(); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 322var buffer = _headerEncodingBuffer.AsSpan(); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 326var payload = buffer.Slice(extendedHeaderLength); 366var buffer = _headerEncodingBuffer.AsSpan(); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 416internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 728var payload = new byte[priorityFrame.PayloadLength].AsSpan();
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
IIS.NewShim.FunctionalTests (57)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (15)
181var buffer = _headerEncodingBuffer.AsSpan(); 249var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 282var buffer = _headerEncodingBuffer.AsSpan(); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 322var buffer = _headerEncodingBuffer.AsSpan(); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 326var payload = buffer.Slice(extendedHeaderLength); 366var buffer = _headerEncodingBuffer.AsSpan(); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 416internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 728var payload = new byte[priorityFrame.PayloadLength].AsSpan();
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
IIS.ShadowCopy.Tests (13)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
IISExpress.FunctionalTests (57)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (15)
181var buffer = _headerEncodingBuffer.AsSpan(); 249var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 282var buffer = _headerEncodingBuffer.AsSpan(); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 322var buffer = _headerEncodingBuffer.AsSpan(); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 326var payload = buffer.Slice(extendedHeaderLength); 366var buffer = _headerEncodingBuffer.AsSpan(); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 416internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 728var payload = new byte[priorityFrame.PayloadLength].AsSpan();
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
InMemory.FunctionalTests (37)
ChunkedResponseTests.cs (1)
877var span = response.BodyWriter.GetSpan(4096);
Http2\Http2StreamTests.cs (2)
3551var span = response.BodyWriter.GetSpan(); 3869var span = response.BodyWriter.GetSpan(4096);
Http2\Http2TestBase.cs (13)
601protected Task StartStreamAsync(int streamId, Span<byte> headerData, bool endStream) 632var buffer = _headerEncodingBuffer.AsSpan(); 633var extendedHeader = buffer.Slice(0, extendedHeaderLength); 635var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 638var padding = buffer.Slice(extendedHeaderLength + length, padLength); 674var buffer = _headerEncodingBuffer.AsSpan(); 675var extendedHeader = buffer.Slice(0, extendedHeaderLength); 678var payload = buffer.Slice(extendedHeaderLength); 720var buffer = _headerEncodingBuffer.AsSpan(); 721var extendedHeader = buffer.Slice(0, extendedHeaderLength); 725var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 728var padding = buffer.Slice(extendedHeaderLength + length, padLength); 1089var payload = new byte[priorityFrame.PayloadLength].AsSpan();
Http3\WebTransport\WebTransportTestUtilities.cs (1)
135public Span<byte> GetSpan(int sizeHint = 0)
ResponseTests.cs (1)
3637var span = response.BodyWriter.GetSpan(4096);
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = 0)
src\Servers\Kestrel\shared\HPackHeaderWriter.cs (5)
20public static bool BeginEncodeHeaders(int statusCode, DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 51public static bool BeginEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 74public static bool ContinueEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 79private static bool EncodeStatusHeader(int statusCode, DynamicHPackEncoder hpackEncoder, Span<byte> buffer, out int length) 94private static bool EncodeHeadersCore(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (5)
722await SendAsync(Span<byte>.Empty); 779_headerHandler.DecodedHeaders[((Span<byte>)knownHeader.Name).GetAsciiStringNonNullCharacters()] = HttpUtilities.GetAsciiOrUTF8StringNonNullCharacters((ReadOnlySpan<byte>)knownHeader.Value); 784_headerHandler.DecodedHeaders[((Span<byte>)H3StaticTable.Get(index).Name).GetAsciiStringNonNullCharacters()] = value.GetAsciiOrUTF8StringNonNullCharacters(); 869var buffer = pw.GetSpan(sizeHint: 8); 907internal static void WriteSettings(List<Http3PeerSetting> settings, Span<byte> destination)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
58public override Span<byte> GetSpan(int sizeHint = 0) => _output.GetSpan(sizeHint);
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (2)
35var buffer = headerEncodingBuffer.AsSpan(); 69public static void WriteStartStream(this PipeWriter writer, int streamId, Span<byte> headerData, bool endStream, Http2Frame frame = null)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
99public override Span<byte> GetSpan()
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
53Span<byte> alloc = GetSpan(toAlloc, out bool mustCommit); 71public Span<T> AllocAsSpan<T>(int count) where T : unmanaged 89Span<byte> buffer = GetSpan(maxAlloc, out bool mustCommit); 117private Span<byte> GetSpan(int sizeHint, out bool mustCommit)
Microsoft.AspNetCore.App.Analyzers (1)
Infrastructure\VirtualChars\VirtualChar.cs (1)
150Span<char> chars = stackalloc char[2];
Microsoft.AspNetCore.Authentication.Certificate (2)
X509CertificateExtensions.cs (2)
21Span<byte> subject = certificate.SubjectName.RawData; 22Span<byte> issuer = certificate.IssuerName.RawData;
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
UserJwtsTests.cs (1)
597var buffer = new Span<byte>(new byte[key.Length]);
Microsoft.AspNetCore.Components (17)
ParameterView.cs (3)
216var oldDirectParameterFrames = GetDirectParameterFrames(oldParameters); 223var newDirectParameterFrames = GetDirectParameterFrames(this); 252static Span<RenderTreeFrame> GetDirectParameterFrames(in ParameterView parameterView)
Routing\RouteContext.cs (3)
27var utf8Span = uriBuffer.Buffer; 57public Span<byte> Buffer { get; } 65public UriBuffer(Span<byte> buffer) => Buffer = buffer;
src\Shared\UrlDecoder\UrlDecoder.cs (11)
18public static int DecodeRequestLine(ReadOnlySpan<byte> source, Span<byte> destination, bool isFormEncoding) 42public static int DecodeInPlace(Span<byte> buffer, bool isFormEncoding) 96private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<byte> buffer, bool isFormEncoding) 234private static void Copy<T>(int begin, int end, ref int writer, Span<T> buffer) 262private static int UnescapePercentEncoding(ref int scan, Span<byte> buffer, bool isFormEncoding) 301private static int ReadHex(ref int scan, Span<byte> buffer) 355/// Form Encoding is not supported compared to the <see cref="DecodeRequestLine(ReadOnlySpan{byte}, Span{byte}, bool)" /> 358public static int DecodeRequestLine(ReadOnlySpan<char> source, Span<char> destination) 374/// Form Encoding is not supported compared to the <see cref="DecodeInPlace(Span{byte}, bool)" /> 377public static int DecodeInPlace(Span<char> buffer) 434private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<char> buffer)
Microsoft.AspNetCore.Components.Endpoints (6)
DependencyInjection\ServerComponentInvocationSequence.cs (1)
15Span<byte> bytes = stackalloc byte[16];
FormMapping\Converters\CollectionConverter.cs (1)
160Span<char> computedPrefix = stackalloc char[16];
Rendering\Buffering\TextChunk.cs (1)
45charArraySegmentScope.Append((Span<char>)value);
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
122var componentIdsInDepthOrder = bufSizeRequired < 1024
Rendering\TypeNameHash.cs (2)
21Span<byte> typeNameBytes = stackalloc byte[MaxStackBufferSize]; 29Span<byte> typeNameHashBytes = stackalloc byte[SHA256.HashSizeInBytes];
Microsoft.AspNetCore.Components.Forms (3)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (3)
16private Span<char> _currentBuffer; 30public ReverseStringBuilder(Span<char> initialBuffer) 95Span<char> result = stackalloc char[11];
Microsoft.AspNetCore.Components.Forms.Tests (5)
ReverseStringBuilderTest.cs (5)
12Span<char> initialBuffer = stackalloc char[128]; 27using var builder = new ReverseStringBuilder(Span<char>.Empty); 41Span<char> initialBuffer = stackalloc char[128]; 60Span<char> initialBuffer = stackalloc char[128]; 80Span<char> initialBuffer = stackalloc char[8];
Microsoft.AspNetCore.Components.Server (82)
BlazorPack\SequenceOfT.cs (2)
184public Span<T> GetSpan(int sizeHint) => this.GetSegment(sizeHint).RemainingSpan; 325internal Span<T> RemainingSpan => this.AvailableMemory.Span.Slice(this.End);
Circuits\ServerComponentDeserializer.cs (1)
304Span<int> seenSsrComponentIds = operations.Length <= 128
src\Shared\PooledArrayBufferWriter.cs (2)
134public Span<T> GetSpan(int sizeHint = 0) 168var previousBuffer = oldBuffer.AsSpan(0, _index);
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
372var span = array.AsSpan();
src\SignalR\common\Shared\BinaryMessageFormatter.cs (2)
13Span<byte> lenBuffer = stackalloc byte[5]; 20public static int WriteLengthPrefix(long length, Span<byte> output)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\BufferWriter.cs (4)
28private Span<byte> _span; 90public Span<byte> Span => _span; 104public Span<byte> GetSpan(int sizeHint) 254var realSpan = _output.GetSpan(_buffered);
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackWriter.cs (65)
89Span<byte> span = this.writer.GetSpan(1); 133Span<byte> span = this.writer.GetSpan(1); 139Span<byte> span = this.writer.GetSpan(3); 146Span<byte> span = this.writer.GetSpan(5); 173Span<byte> span = this.writer.GetSpan(1); 179Span<byte> span = this.writer.GetSpan(3); 186Span<byte> span = this.writer.GetSpan(5); 201Span<byte> span = this.writer.GetSpan(1); 217Span<byte> span = this.writer.GetSpan(2); 235Span<byte> span = this.writer.GetSpan(1); 247Span<byte> span = this.writer.GetSpan(2); 261Span<byte> span = this.writer.GetSpan(1); 267Span<byte> span = this.writer.GetSpan(2); 284Span<byte> span = this.writer.GetSpan(3); 310Span<byte> span = this.writer.GetSpan(1); 316Span<byte> span = this.writer.GetSpan(2); 334Span<byte> span = this.writer.GetSpan(3); 353Span<byte> span = this.writer.GetSpan(1); 359Span<byte> span = this.writer.GetSpan(2); 366Span<byte> span = this.writer.GetSpan(3); 383Span<byte> span = this.writer.GetSpan(5); 412Span<byte> span = this.writer.GetSpan(1); 418Span<byte> span = this.writer.GetSpan(2); 425Span<byte> span = this.writer.GetSpan(3); 443Span<byte> span = this.writer.GetSpan(5); 464Span<byte> span = this.writer.GetSpan(1); 470Span<byte> span = this.writer.GetSpan(2); 477Span<byte> span = this.writer.GetSpan(3); 484Span<byte> span = this.writer.GetSpan(5); 501Span<byte> span = this.writer.GetSpan(9); 531Span<byte> span = this.writer.GetSpan(1); 537Span<byte> span = this.writer.GetSpan(2); 544Span<byte> span = this.writer.GetSpan(3); 551Span<byte> span = this.writer.GetSpan(5); 569Span<byte> span = this.writer.GetSpan(9); 581Span<byte> span = this.writer.GetSpan(1); 598Span<byte> span = this.writer.GetSpan(5); 610Span<byte> span = this.writer.GetSpan(9); 682Span<byte> span = this.writer.GetSpan(6); 691Span<byte> span = this.writer.GetSpan(10); 701Span<byte> span = this.writer.GetSpan(15); 746var span = this.writer.GetSpan(length); 765var span = this.writer.GetSpan(length); 800Span<byte> span = this.writer.GetSpan(size); 810Span<byte> span = this.writer.GetSpan(size); 820Span<byte> span = this.writer.GetSpan(size); 841Span<byte> span = this.writer.GetSpan(length); 858Span<byte> span = this.writer.GetSpan(length); 882Span<byte> span = this.writer.GetSpan(byteCount + 1); 888Span<byte> span = this.writer.GetSpan(byteCount + 2); 895Span<byte> span = this.writer.GetSpan(byteCount + 3); 902Span<byte> span = this.writer.GetSpan(byteCount + 5); 974Span<byte> span = this.writer.GetSpan(2); 1067public Span<byte> GetSpan(int length) => this.writer.GetSpan(length); 1082Span<byte> span = this.writer.GetSpan(2); 1093Span<byte> span = this.writer.GetSpan(4); 1104Span<byte> span = this.writer.GetSpan(8); 1129private static void WriteBigEndian(short value, Span<byte> span) => WriteBigEndian(unchecked((ushort)value), span); 1131private static void WriteBigEndian(int value, Span<byte> span) => WriteBigEndian(unchecked((uint)value), span); 1133private static void WriteBigEndian(long value, Span<byte> span) => WriteBigEndian(unchecked((ulong)value), span); 1135private static void WriteBigEndian(ushort value, Span<byte> span) 1154private static void WriteBigEndian(uint value, Span<byte> span) 1177private static void WriteBigEndian(ulong value, Span<byte> span) 1193private static unsafe void WriteBigEndian(float value, Span<byte> span) => WriteBigEndian(*(int*)&value, span); 1195private static unsafe void WriteBigEndian(double value, Span<byte> span) => WriteBigEndian(*(long*)&value, span);
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (2)
454public bool TryCopyTo(Span<T> destination) 466internal bool TryCopyMultisegment(Span<T> destination)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReaderExtensions.cs (1)
76Span<byte> tempSpan = new Span<byte>(&buffer, sizeof(T));
Microsoft.AspNetCore.Components.Server.Tests (11)
Circuits\RenderBatchWriterTest.cs (10)
24var bytes = Serialize(new RenderBatch()); 46var bytes = Serialize(new RenderBatch( 73var bytes = Serialize(new RenderBatch( 100var bytes = Serialize(new RenderBatch( 158var bytes = Serialize(new RenderBatch( 197var bytes = Serialize(new RenderBatch( 273private Span<byte> Serialize(RenderBatch renderBatch) 283static string[] ReadStringTable(Span<byte> data) 307static void AssertBinaryContents(Span<byte> data, int startIndex, params object[] entries) 355static int ReadInt(Span<byte> bytes, int startOffset)
src\Components\Endpoints\src\DependencyInjection\ServerComponentInvocationSequence.cs (1)
15Span<byte> bytes = stackalloc byte[16];
Microsoft.AspNetCore.Components.Web (3)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (3)
16private Span<char> _currentBuffer; 30public ReverseStringBuilder(Span<char> initialBuffer) 95Span<char> result = stackalloc char[11];
Microsoft.AspNetCore.DataProtection (7)
KeyManagement\KeyRingBasedDataProtector.cs (1)
295var span = new Span<byte>(ptr, sizeof(Guid));
Managed\AesGcmAuthenticatedEncryptor.cs (6)
124var nonce = new Span<byte>(ciphertext.Array, nonceOffset, NONCE_SIZE_IN_BYTES); 125var tag = new Span<byte>(ciphertext.Array, tagOffset, TAG_SIZE_IN_BYTES); 126var encrypted = new Span<byte>(ciphertext.Array, encryptedDataOffset, plaintextBytes); 197var nonce = new Span<byte>(retVal, nonceOffset, NONCE_SIZE_IN_BYTES); 198var tag = new Span<byte>(retVal, tagOffset, TAG_SIZE_IN_BYTES); 199var encrypted = new Span<byte>(retVal, encryptedDataOffset, plaintext.Count);
Microsoft.AspNetCore.DataProtection.Abstractions (2)
src\Shared\WebEncoders\WebEncoders.cs (2)
327Span<char> buffer = bufferSize <= StackAllocThreshold 342private static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
Microsoft.AspNetCore.Http (1)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
540private Span<KeyValuePair<TKey, TValue>> ArrayStorageSpan
Microsoft.AspNetCore.Http.Abstractions (18)
Extensions\HttpResponseWritingExtensions.cs (2)
76var destination = pipeWriter.GetSpan(minimumByteSize); 100private static void WriteMultiSegmentEncoded(PipeWriter writer, string text, Encoding encoding, Span<byte> destination, int encodedLength, int minimumByteSize)
PathString.cs (2)
187Span<char> pathBuffer = uriComponent.Length <= StackAllocThreshold ? stackalloc char[StackAllocThreshold] : new char[uriComponent.Length]; 203Span<char> pathBuffer = uriComponent.Length < StackAllocThreshold ? stackalloc char[StackAllocThreshold] : new char[uriComponent.Length + 1];
src\Shared\UrlDecoder\UrlDecoder.cs (11)
18public static int DecodeRequestLine(ReadOnlySpan<byte> source, Span<byte> destination, bool isFormEncoding) 42public static int DecodeInPlace(Span<byte> buffer, bool isFormEncoding) 96private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<byte> buffer, bool isFormEncoding) 234private static void Copy<T>(int begin, int end, ref int writer, Span<T> buffer) 262private static int UnescapePercentEncoding(ref int scan, Span<byte> buffer, bool isFormEncoding) 301private static int ReadHex(ref int scan, Span<byte> buffer) 355/// Form Encoding is not supported compared to the <see cref="DecodeRequestLine(ReadOnlySpan{byte}, Span{byte}, bool)" /> 358public static int DecodeRequestLine(ReadOnlySpan<char> source, Span<char> destination) 374/// Form Encoding is not supported compared to the <see cref="DecodeInPlace(Span{byte}, bool)" /> 377public static int DecodeInPlace(Span<char> buffer) 434private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<char> buffer)
src\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
Microsoft.AspNetCore.Http.Connections (5)
Internal\HttpConnectionManager.cs (1)
111Span<byte> buffer = stackalloc byte[16];
src\Shared\WebEncoders\WebEncoders.cs (2)
327Span<char> buffer = bufferSize <= StackAllocThreshold 342private static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
Microsoft.AspNetCore.Http.Connections.Common (3)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
111var destination = GetBuffer(); 140private Span<byte> GetBuffer() 172var destination = GetBuffer();
Microsoft.AspNetCore.Http.Extensions (13)
src\Components\Endpoints\src\FormMapping\Converters\CollectionConverter.cs (1)
160Span<char> computedPrefix = stackalloc char[16];
src\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (7)
15private Span<char> _chars; 18public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 119public bool TryCopyTo(Span<char> destination, out int charsWritten) 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 259public Span<char> AppendSpan(int length)
UriHelper.cs (2)
235private static int CopyTextToBuffer(Span<char> buffer, int index, ReadOnlySpan<char> text) 246private static void InitializeAbsoluteUriString(Span<char> buffer, (string scheme, string host, string pathBase, string path, string query, string fragment) uriParts)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateFactoryTests.cs (1)
903Span<byte> Method2() => "hello world"u8.ToArray();
Microsoft.AspNetCore.HttpLogging (11)
BufferingStream.cs (1)
124public Span<byte> GetSpan(int sizeHint = 0)
src\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (7)
15private Span<char> _chars; 18public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 119public bool TryCopyTo(Span<char> destination, out int charsWritten) 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 259public Span<char> AppendSpan(int length)
Microsoft.AspNetCore.Identity.FunctionalTests (6)
src\Identity\Extensions.Core\src\Base32.cs (2)
28Span<byte> bytes = stackalloc byte[length]; 118private static int GetNextGroup(Span<byte> input, ref int offset, out byte a, out byte b, out byte c, out byte d, out byte e, out byte f, out byte g, out byte h)
src\Identity\Extensions.Core\src\Rfc6238AuthenticationService.cs (4)
38Span<byte> timestepAsBytes = stackalloc byte[sizeof(long)]; 46Span<byte> modifierCombinedBytes = timestepAsBytes; 51Span<byte> hash = stackalloc byte[HMACSHA1.HashSizeInBytes]; 70private static byte[] ApplyModifier(Span<byte> input, byte[] modifierBytes)
Microsoft.AspNetCore.Localization (1)
CookieRequestCultureProvider.cs (1)
72Span<Range> parts = stackalloc Range[3];
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
src\Shared\PooledArrayBufferWriter.cs (2)
134public Span<T> GetSpan(int sizeHint = 0) 168var previousBuffer = oldBuffer.AsSpan(0, _index);
Microsoft.AspNetCore.OpenApi (5)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
111var destination = GetBuffer(); 140private Span<byte> GetBuffer() 172var destination = GetBuffer();
Microsoft.AspNetCore.OutputCaching (6)
FormatterBinaryWriter.cs (3)
33private Span<byte> AvailableBuffer 110var span = target.GetSpan(1024); // fairly arbitrary non-trivial buffer; we can explore larger if useful 199var available = AvailableBuffer;
RecyclableArrayBufferWriter.cs (1)
70public Span<T> GetSpan(int sizeHint = 0)
RecyclableSequenceBuilder.cs (2)
59private Span<byte> GetBuffer() 91var available = GetBuffer();
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (2)
EndToEndBenchmarks.cs (2)
97var span = destination.GetSpan(bytes); 279public override Span<byte> GetSpan(int sizeHint = 0) => _buffer;
Microsoft.AspNetCore.Razor.Runtime (1)
Runtime\TagHelpers\TagHelperRunner.cs (1)
26var tagHelpers = CollectionsMarshal.AsSpan(executionContext.TagHelperList);
Microsoft.AspNetCore.ResponseCaching (1)
CacheEntry\CachedResponseBody.cs (1)
36var span = destination.GetSpan(segment.Length);
Microsoft.AspNetCore.Rewrite (1)
ApacheModRewrite\FlagParser.cs (1)
70Span<Range> hasPayload = stackalloc Range[3];
Microsoft.AspNetCore.Routing (13)
Matching\DefaultEndpointSelector.cs (3)
22internal static void Select(HttpContext httpContext, Span<CandidateState> candidateState) 58Span<CandidateState> candidateState) 107private static void ReportAmbiguity(Span<CandidateState> candidateState)
Matching\DfaMatcher.cs (3)
45Span<PathSegment> buffer = stackalloc PathSegment[_maxSegmentCount]; 47var segments = buffer.Slice(0, count); 110? ((Span<CandidateState>)candidateStateStackArray)[..candidateCount]
Matching\DfaMatcherBuilder.cs (1)
428var hasFailingPolicy = parent.Literals.Keys.Count < 32 ?
Matching\FastPathTokenizer.cs (1)
15public static int Tokenize(string path, Span<PathSegment> segments)
Matching\HostMatcherPolicy.cs (1)
157Span<Range> hostParts = stackalloc Range[3];
Matching\HttpMethodMatcherPolicy.cs (1)
398var methods = CollectionsMarshal.AsSpan(httpMethods);
Matching\ILEmitTrieFactory.cs (3)
126void EmitIfLadder(Span<IGrouping<int, (string text, int destination)>> groups) 344void EmitIfLadder(Span<IGrouping<ulong, (string test, int destination)>> groups) 469void EmitIfLadder(Span<IGrouping<ushort, (string test, int destination)>> groups)
Microsoft.AspNetCore.Routing.Microbenchmarks (4)
Matching\FastPathTokenizerEmptyBenchmark.cs (1)
27Span<PathSegment> segments = stackalloc PathSegment[MaxCount];
Matching\FastPathTokenizerLargeBenchmark.cs (1)
31Span<PathSegment> segments = stackalloc PathSegment[MaxCount];
Matching\FastPathTokenizerPlaintextBenchmark.cs (1)
27Span<PathSegment> segments = stackalloc PathSegment[MaxCount];
Matching\FastPathTokenizerSmallBenchmark.cs (1)
27Span<PathSegment> segments = stackalloc PathSegment[MaxCount];
Microsoft.AspNetCore.Routing.Tests (8)
Matching\FastPathTokenizerTest.cs (8)
14Span<PathSegment> segments = stackalloc PathSegment[1]; 27Span<PathSegment> segments = stackalloc PathSegment[1]; 40Span<PathSegment> segments = stackalloc PathSegment[1]; 54Span<PathSegment> segments = stackalloc PathSegment[3]; 70Span<PathSegment> segments = stackalloc PathSegment[3]; 86Span<PathSegment> segments = stackalloc PathSegment[3]; 102Span<PathSegment> segments = stackalloc PathSegment[3]; 118Span<PathSegment> segments = stackalloc PathSegment[3];
Microsoft.AspNetCore.Server.HttpSys (37)
RequestProcessing\Request.cs (1)
57var rawUrlInBytes = requestContext.GetRawUrlInBytes();
RequestProcessing\Response.cs (4)
280Span<HTTP_DATA_CHUNK> dataChunks, 482Span<HTTP_UNKNOWN_HEADER> unknownHeaders = default; 483Span<HTTP_RESPONSE_INFO> knownHeaderInfo = default; 579var nativeHeaderValues = new Span<HTTP_KNOWN_HEADER>(headerAlloc, headerValues.Count);
RequestProcessing\ResponseBody.cs (6)
144Span<GCHandle> pinnedBuffers = default; 190private unsafe void BuildDataChunks(scoped ref UnmanagedBufferAllocator allocator, bool endOfRequest, ArraySegment<byte> data, out Span<HTTP_DATA_CHUNK> dataChunks, out Span<GCHandle> pins) 276Span<HTTP_DATA_CHUNK> chunks, 286Span<HTTP_DATA_CHUNK> chunks, 299private static void FreeDataBuffers(Span<GCHandle> pinnedBuffers)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
99public override Span<byte> GetSpan()
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
53Span<byte> alloc = GetSpan(toAlloc, out bool mustCommit); 71public Span<T> AllocAsSpan<T>(int count) where T : unmanaged 89Span<byte> buffer = GetSpan(maxAlloc, out bool mustCommit); 117private Span<byte> GetSpan(int sizeHint, out bool mustCommit)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
274internal Span<byte> GetRawUrlInBytes() 501internal void GetUnknownKeys(Span<string> destination) 518private void PopulateUnknownKeys(HTTP_REQUEST_V1* request, long fixup, Span<string> destination) 831public override Span<T> GetSpan()
src\Shared\HttpSys\RequestProcessing\PathNormalizer.cs (1)
14public static unsafe int RemoveDotSegments(Span<byte> input)
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (4)
11public static Span<byte> GetPath(Span<byte> raw) 73private static int FindHttpOrHttps(Span<byte> raw) 133private static int Find(Span<byte> raw, int begin, byte target)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
278private int GetKnownHeadersKeys(Span<string> observedHeaders)
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (7)
20public static string DecodeAndUnescapePath(Span<byte> rawUrlBytes) 23var rawPath = RawUrlHelper.GetPath(rawUrlBytes); 37var unescapedPath = Unescape(rawPath); 49private static Span<byte> Unescape(Span<byte> rawPath) 101private static bool DecodeCore(ref int reader, ref int writer, int end, Span<byte> buffer) 237private static void Copy(int begin, int end, ref int writer, Span<byte> buffer)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (53)
src\Shared\Http2cat\HPackHeaderWriter.cs (5)
16public static bool BeginEncodeHeaders(int statusCode, IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 40public static bool BeginEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 54public static bool ContinueEncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, out int length) 59private static bool EncodeHeaders(IEnumerator<KeyValuePair<string, string>> headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length) 86private static bool EncodeHeader(string name, string value, Span<byte> buffer, out int length)
src\Shared\Http2cat\Http2Utilities.cs (15)
181var buffer = _headerEncodingBuffer.AsSpan(); 249var buffer = output.GetSpan(Http2FrameReader.HeaderLength); 282var buffer = _headerEncodingBuffer.AsSpan(); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 322var buffer = _headerEncodingBuffer.AsSpan(); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 326var payload = buffer.Slice(extendedHeaderLength); 366var buffer = _headerEncodingBuffer.AsSpan(); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 416internal static void WriteSettings(IList<Http2PeerSetting> settings, Span<byte> destination) 728var payload = new byte[priorityFrame.PayloadLength].AsSpan();
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks (9)
RequestHeaderBenchmarks.cs (9)
57var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 60var remainingMemory = SetUnknownHeaders(nativeMemory, ref requestStructure, GenerateUnknownHeaders(unknowHeaderCount)); 69private unsafe Span<byte> SetHostHeader(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure) 72var dataDestination = nativeMemory[Marshal.SizeOf<HTTP_REQUEST_V1>()..]; 85private unsafe Span<byte> SetUnknownHeaders(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure, IReadOnlyCollection<(string Key, string Value)> headerNames) 87var unknownHeaderStructureDestination = nativeMemory[Marshal.SizeOf<HTTP_REQUEST_V1>()..]; 95var dataDestination = unknownHeaderStructureDestination[(unknownHeadersSize * headerNames.Count)..];
Microsoft.AspNetCore.Server.HttpSys.Tests (32)
RequestHeaderTests.cs (32)
23var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 44Span<byte> nativeMemory = buffer.Span; 64var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 85Span<byte> nativeMemory = buffer.Span; 105var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 124var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 143var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 146var remainingMemory = SetUnknownHeaders(nativeMemory, ref requestStructure, new[] { (CustomHeader1, "1"), (CustomHeader2, null) }); 167Span<byte> nativeMemory = buffer.Span; 170var remainingMemory = SetUnknownHeaders(nativeMemory, ref requestStructure, new[] { (CustomHeader1, "1"), (CustomHeader2, null) }); 190var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 212var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 234var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 255var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 275var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 297var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 319var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 340var nativeMemory = new Span<byte>(nativeContext.NativeRequest, (int)nativeContext.Size + 8); 356private static unsafe Span<byte> SetHostAndContentTypeHeaders(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure) 359var dataDestination = nativeMemory.Slice(Marshal.SizeOf<HTTP_REQUEST_V1>()); 380private static unsafe Span<byte> SetInvalidHostHeader(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure) 383var dataDestination = nativeMemory.Slice(Marshal.SizeOf<HTTP_REQUEST_V1>()); 400private static unsafe Span<byte> SetUnknownHeaders(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure, IReadOnlyCollection<(string Key, string Value)> headerNames) 402var unknownHeaderStructureDestination = nativeMemory.Slice(Marshal.SizeOf<HTTP_REQUEST_V1>()); 410var dataDestination = unknownHeaderStructureDestination.Slice(unknownHeadersSize * headerNames.Count); 438private static unsafe Span<byte> SetInvalidUnknownHeaders(Span<byte> nativeMemory, ref HTTP_REQUEST_V1 requestStructure, IReadOnlyCollection<string> headerNames) 440var unknownHeaderStructureDestination = nativeMemory.Slice(Marshal.SizeOf<HTTP_REQUEST_V1>()); 450var dataDestination = unknownHeaderStructureDestination.Slice(unknownHeadersSize * headerNames.Count);
Microsoft.AspNetCore.Server.IIS (33)
Core\IISHttpContext.cs (1)
315var rawUrlInBytes = GetRawUrlInBytes();
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
99public override Span<byte> GetSpan()
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
53Span<byte> alloc = GetSpan(toAlloc, out bool mustCommit); 71public Span<T> AllocAsSpan<T>(int count) where T : unmanaged 89Span<byte> buffer = GetSpan(maxAlloc, out bool mustCommit); 117private Span<byte> GetSpan(int sizeHint, out bool mustCommit)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
274internal Span<byte> GetRawUrlInBytes() 501internal void GetUnknownKeys(Span<string> destination) 518private void PopulateUnknownKeys(HTTP_REQUEST_V1* request, long fixup, Span<string> destination) 831public override Span<T> GetSpan()
src\Shared\HttpSys\RequestProcessing\PathNormalizer.cs (1)
14public static unsafe int RemoveDotSegments(Span<byte> input)
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (4)
11public static Span<byte> GetPath(Span<byte> raw) 73private static int FindHttpOrHttps(Span<byte> raw) 133private static int Find(Span<byte> raw, int begin, byte target)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
278private int GetKnownHeadersKeys(Span<string> observedHeaders)
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (7)
20public static string DecodeAndUnescapePath(Span<byte> rawUrlBytes) 23var rawPath = RawUrlHelper.GetPath(rawUrlBytes); 37var unescapedPath = Unescape(rawPath); 49private static Span<byte> Unescape(Span<byte> rawPath) 101private static bool DecodeCore(ref int reader, ref int writer, int end, Span<byte> buffer) 237private static void Copy(int begin, int end, ref int writer, Span<byte> buffer)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
Microsoft.AspNetCore.Server.Kestrel.Core (146)
Internal\Http\ChunkWriter.cs (2)
11public static int BeginChunkBytes(int dataCount, Span<byte> span) 150var span = start.Span;
Internal\Http\Http1Connection.cs (10)
278public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine) 282var target = startLine[targetStart..]; 325private void OnOriginFormTarget(TargetOffsetPathLength targetPath, Span<byte> target) 366private void ParseTarget(TargetOffsetPathLength targetPath, Span<byte> target) 405var path = target[..pathLength]; 415private int ParseQuery(TargetOffsetPathLength targetPath, Span<byte> target) 418var query = target[targetPath.Length..]; 437private void OnAuthorityFormTarget(HttpMethod method, Span<byte> target) 508private void OnAbsoluteFormTarget(TargetOffsetPathLength targetPath, Span<byte> target) 510Span<byte> query = target[targetPath.Length..];
Internal\Http\Http1OutputProducer.cs (1)
213public Span<byte> GetSpan(int sizeHint = 0)
Internal\Http\Http1ParsingHandler.cs (1)
47public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine)
Internal\Http\HttpParser.cs (2)
176var startLine = MemoryMarshal.CreateSpan(ref MemoryMarshal.GetReference(requestLine), queryEnd); 416Span<byte> headerSpan = headerLength <= 256 ? stackalloc byte[256] : array = ArrayPool<byte>.Shared.Rent(headerLength);
Internal\Http\HttpProtocol.cs (2)
1384public void ThrowRequestTargetRejected(Span<byte> target) 1491public Span<byte> GetSpan(int sizeHint = 0)
Internal\Http\HttpRequestHeaders.cs (1)
121Span<char> decodedChars = stackalloc char[20];
Internal\Http\HttpResponsePipeWriter.cs (1)
58public override Span<byte> GetSpan(int sizeHint = 0)
Internal\Http\IHttpOutputProducer.cs (1)
19Span<byte> GetSpan(int sizeHint = 0);
Internal\Http\IHttpRequestLineHandler.cs (1)
21Span<byte> startLine);
Internal\Http\IHttpResponseControl.cs (1)
12Span<byte> GetSpan(int sizeHint = 0);
Internal\Http\IHttpResponsePipeWriterControl.cs (1)
12Span<byte> GetSpan(int sizeHint = 0);
Internal\Http\PathNormalizer.cs (2)
16public static string DecodePath(Span<byte> path, bool pathEncoded, string rawTarget, int queryLength) 53public static unsafe int RemoveDotSegments(Span<byte> input)
Internal\Http2\Http2FrameWriter.cs (9)
488var buffer = _headerEncodingBuffer.AsSpan(); 529var buffer = _headerEncodingBuffer.AsSpan(); 547var buffer = _headerEncodingBuffer.AsSpan(); 731var buffer = _outputWriter.GetSpan(4); 754var buffer = _outputWriter.GetSpan(4); 784var buffer = _outputWriter.GetSpan(settingsSize).Slice(0, settingsSize); // GetSpan isn't precise 792internal static void WriteSettings(List<Http2PeerSetting> settings, Span<byte> destination) 867var buffer = _outputWriter.GetSpan(8); 899var buffer = output.GetSpan(Http2FrameReader.HeaderLength);
Internal\Http2\Http2OutputProducer.cs (1)
472public Span<byte> GetSpan(int sizeHint = 0)
Internal\Http2\Http2Stream.cs (1)
422Span<byte> pathBuffer = pathSegment.Length <= MaxPathBufferStackAllocSize
Internal\Http3\Http3FrameWriter.cs (8)
106var buffer = _outputWriter.GetSpan(settingsLength + VariableLengthIntegerHelper.MaximumEncodedLength + 1); 141internal static void WriteSettings(List<Http3PeerSetting> settings, Span<byte> destination) 155var buffer = _outputWriter.GetSpan(8); 247var buffer = _outputWriter.GetSpan(8); 282var buffer = output.GetSpan(16); 312var buffer = _headerEncodingBuffer.GetSpan(HeaderBufferSize); 367var buffer = _headerEncodingBuffer.GetSpan(HeaderBufferSize); 390var buffer = _headerEncodingBuffer.GetSpan(HeaderBufferSize);
Internal\Http3\Http3OutputProducer.cs (1)
199public Span<byte> GetSpan(int sizeHint = 0)
Internal\Http3\Http3Stream.cs (1)
1144Span<byte> pathBuffer = pathSegment.Length <= MaxPathBufferStackAllocSize
Internal\Http3\QPack\DynamicTable.cs (2)
30public static void Insert(Span<byte> name, Span<byte> value)
Internal\Http3\QPack\EncoderStreamReader.cs (2)
257var headerNameSpan = new Span<byte>(_headerName, 0, _headerNameLength); 258var headerValueSpan = new Span<byte>(_headerValueOctets, 0, _headerValueLength);
Internal\Http3\QPackHeaderWriter.cs (6)
12public static bool BeginEncodeHeaders(Http3HeadersEnumerator enumerator, Span<byte> buffer, ref int totalHeaderSize, out int length) 27public static bool BeginEncodeHeaders(int statusCode, Http3HeadersEnumerator headersEnumerator, Span<byte> buffer, ref int totalHeaderSize, out int length) 50public static bool Encode(Http3HeadersEnumerator headersEnumerator, Span<byte> buffer, ref int totalHeaderSize, out int length) 55private static bool Encode(Http3HeadersEnumerator headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, ref int totalHeaderSize, out int length) 104private static bool EncodeHeader(Span<byte> buffer, int staticTableId, string name, string value, Encoding? valueEncoding, out int headerLength) 111private static int EncodeStatusCode(int statusCode, Span<byte> buffer)
Internal\Infrastructure\HttpUtilities.cs (5)
57Span<byte> bytes = stackalloc byte[8]; 69Span<byte> bytes = stackalloc byte[4]; 99private static unsafe void GetHeaderName(Span<char> buffer, IntPtr state) 112public static string GetAsciiStringNonNullCharacters(this Span<byte> span) 416public static bool GetKnownHttpScheme(this Span<byte> span, out HttpScheme knownScheme)
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (1)
79public override Span<byte> GetSpan(int sizeHint = 0)
Internal\Infrastructure\StatusCheckPipeWriter.cs (1)
70public override Span<byte> GetSpan(int sizeHint = 0)
Internal\Infrastructure\ThrowingPipeWriter.cs (1)
27public override Span<byte> GetSpan(int sizeHint = 0) => throw new InvalidOperationException(_message);
Internal\Infrastructure\WrappingPipeWriter.cs (1)
51public override Span<byte> GetSpan(int sizeHint = 0)
Middleware\Internal\LoggingStream.cs (2)
86public override int Read(Span<byte> destination) 170Span<char> charBuilder = stackalloc char[17];
src\Servers\Kestrel\shared\HPackHeaderWriter.cs (5)
20public static bool BeginEncodeHeaders(int statusCode, DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 51public static bool BeginEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 74public static bool ContinueEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 79private static bool EncodeStatusHeader(int statusCode, DynamicHPackEncoder hpackEncoder, Span<byte> buffer, out int length) 94private static bool EncodeHeadersCore(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length)
src\Shared\Hpack\DynamicHPackEncoder.cs (3)
54public bool EnsureDynamicTableSizeUpdate(Span<byte> buffer, out int length) 68public bool EncodeHeader(Span<byte> buffer, int staticTableIndex, HeaderEncodingHint encodingHint, string name, string value, 117private bool EncodeDynamicHeader(Span<byte> buffer, int staticTableIndex, string name, string value,
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
41public static bool TryWriteFrameEnvelope(Http3FrameType frameType, long payloadLength, Span<byte> buffer, out int bytesWritten)
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (3)
114Span<byte> temp = (stackalloc byte[8])[..length]; 147public static bool TryWrite(Span<byte> buffer, long longToEncode, out int bytesWritten) 190public static int WriteInteger(Span<byte> buffer, long longToEncode)
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (18)
23public static bool EncodeStaticIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 39Span<byte> buffer = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; 61public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Span<byte> destination, out int bytesWritten) 66public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 89/// Encodes just the name part of a Literal Header Field With Static Name Reference. Must call <see cref="EncodeValueString(string, Encoding?, Span{byte}, out int)"/> after to encode the header's value. 93Span<byte> temp = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; 104Span<byte> temp = value.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; 125public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Span<byte> destination, out int bytesWritten) 130public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 147public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 160/// Encodes just the value part of a Literawl Header Field Without Static Name Reference. Must call <see cref="EncodeValueString(string, Encoding?, Span{byte}, out int)"/> after to encode the header's value. 164Span<byte> temp = name.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength] : new byte[name.Length + IntegerEncoder.MaxInt32EncodedLength]; 174Span<byte> temp = (name.Length + value.Length) < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[name.Length + value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; 182private static bool EncodeValueString(string s, Encoding? valueEncoding, Span<byte> buffer, out int length) 220public static bool EncodeValueString(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> buffer, out int length) 301private static void EncodeValueStringPart(string s, Span<byte> buffer) 316private static bool EncodeNameString(string s, Span<byte> buffer, out int length) 355private static bool EncodeHeaderBlockPrefix(Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
src\Shared\UrlDecoder\UrlDecoder.cs (11)
18public static int DecodeRequestLine(ReadOnlySpan<byte> source, Span<byte> destination, bool isFormEncoding) 42public static int DecodeInPlace(Span<byte> buffer, bool isFormEncoding) 96private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<byte> buffer, bool isFormEncoding) 234private static void Copy<T>(int begin, int end, ref int writer, Span<T> buffer) 262private static int UnescapePercentEncoding(ref int scan, Span<byte> buffer, bool isFormEncoding) 301private static int ReadHex(ref int scan, Span<byte> buffer) 355/// Form Encoding is not supported compared to the <see cref="DecodeRequestLine(ReadOnlySpan{byte}, Span{byte}, bool)" /> 358public static int DecodeRequestLine(ReadOnlySpan<char> source, Span<char> destination) 374/// Form Encoding is not supported compared to the <see cref="DecodeInPlace(Span{byte}, bool)" /> 377public static int DecodeInPlace(Span<char> buffer) 434private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<char> buffer)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (79)
AsciiDecoding.cs (6)
28var span = new Span<byte>(byteArray); 36static void Test(Span<byte> asciiBytes) 76var span = new Span<byte>(expectedByteRange); 98var span = new Span<byte>(expectedByteRange); 126var span = new Span<byte>(byteArray); 134static void Test(Span<byte> asciiBytes)
BitShifterTests.cs (3)
16Span<byte> dirtySpan = new byte[] { 0xff, 0xff, 0xff, 0xff }; 28Span<byte> dirtySpan = new byte[] { 0xff, 0xff, 0xff, 0xff }; 40Span<byte> dirtySpan = new byte[] { 0xff, 0xff, 0xff, 0xff };
ChunkWriterTests.cs (1)
41Span<byte> span = new byte[10];
ConcurrentPipeWriterTests.cs (1)
447public override Span<byte> GetSpan(int sizeHint = 0)
Http2\Http2HPackEncoderTests.cs (8)
25Span<byte> buffer = new byte[1024 * 16]; 46Span<byte> buffer = new byte[1024 * 16]; 71Span<byte> buffer = new byte[1024 * 16]; 215Span<byte> buffer = new byte[1024 * 16]; 360Span<byte> buffer = new byte[1024 * 16]; 386Span<byte> buffer = new byte[1024 * 16]; 545Span<byte> payload = new byte[1024]; 580Span<byte> buffer = new byte[1024 * 16];
Http3\Http3QPackEncoderTests.cs (7)
15Span<byte> buffer = new byte[1024 * 16]; 32Span<byte> buffer = new byte[1024 * 16]; 63Span<byte> buffer = new byte[1024 * 16]; 79Span<byte> buffer = new byte[1024 * 16]; 98Span<byte> buffer = new byte[1024 * 16]; 117Span<byte> buffer = new byte[1024 * 16]; 136Span<byte> buffer = new byte[1024 * 16];
HttpParserTests.cs (9)
879public void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded) 889public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine) 893var customMethod = startLine[..versionAndMethod.MethodEnd]; 895var target = startLine[targetStart..]; 896var path = target[..targetPath.Length]; 897var query = target[targetPath.Length..];
HttpRequestHeadersTests.cs (16)
550var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 551var prevSpan = Encoding.UTF8.GetBytes(headerValueUtf16Latin1CrossOver).AsSpan(); 564var headerNameBytes = Encoding.ASCII.GetBytes((string)headerName).AsSpan(); 565var nextSpan = Encoding.Latin1.GetBytes(headerValueUtf16Latin1CrossOver).AsSpan(); 609var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 610var latinValueSpan = Encoding.Latin1.GetBytes(headerValueUtf16Latin1CrossOver).AsSpan(); 656var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 657var valueSpan = Encoding.ASCII.GetBytes(valueString).AsSpan(); 747var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 748var prevSpan = Encoding.UTF8.GetBytes(HeaderValue).AsSpan(); 795var headerNameBytes = Encoding.ASCII.GetBytes(headerName).AsSpan(); 796var prevSpan1 = Encoding.UTF8.GetBytes(HeaderValue1).AsSpan(); 797var prevSpan2 = Encoding.UTF8.GetBytes(HeaderValue2).AsSpan(); 849var headerName = Encoding.ASCII.GetBytes(prevName).AsSpan(); 850var prevSpan = Encoding.UTF8.GetBytes(prevValue).AsSpan(); 861var nextSpan = Encoding.UTF8.GetBytes(nextValue).AsSpan();
src\Servers\Kestrel\shared\HPackHeaderWriter.cs (5)
20public static bool BeginEncodeHeaders(int statusCode, DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 51public static bool BeginEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 74public static bool ContinueEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 79private static bool EncodeStatusHeader(int statusCode, DynamicHPackEncoder hpackEncoder, Span<byte> buffer, out int length) 94private static bool EncodeHeadersCore(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
58public override Span<byte> GetSpan(int sizeHint = 0) => _output.GetSpan(sizeHint);
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (2)
35var buffer = headerEncodingBuffer.AsSpan(); 69public static void WriteStartStream(this PipeWriter writer, int streamId, Span<byte> headerData, bool endStream, Http2Frame frame = null)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
99public override Span<byte> GetSpan()
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
53Span<byte> alloc = GetSpan(toAlloc, out bool mustCommit); 71public Span<T> AllocAsSpan<T>(int count) where T : unmanaged 89Span<byte> buffer = GetSpan(maxAlloc, out bool mustCommit); 117private Span<byte> GetSpan(int sizeHint, out bool mustCommit)
src\Shared\test\Shared.Tests\runtime\Http2\HPackIntegerTest.cs (3)
16Span<byte> actualResult = new byte[64]; 28Span<byte> actualResult = new byte[expectedResult.Length - 1]; 58Span<byte> integerBytes = stackalloc byte[5];
src\Shared\test\Shared.Tests\runtime\Http3\QPackDecoderTest.cs (2)
165Span<byte> buffer = new byte[1024 * 1024]; 346Span<byte> chunk = encoded.AsSpan(i, resolvedSize);
src\Shared\test\Shared.Tests\runtime\Http3\VariableLengthIntegerHelperTests.cs (8)
252Span<byte> span = new Span<byte>(); 267Span<byte> span = new Span<byte>(new byte[1]); 283Span<byte> span = new Span<byte>(new byte[2]); 296Span<byte> span = new Span<byte>(new byte[1]); 311Span<byte> span = new Span<byte>(new byte[4]); 324Span<byte> span = new Span<byte>(new byte[1]); 339Span<byte> span = new Span<byte>(new byte[8]); 352Span<byte> span = new Span<byte>(new byte[1]);
TestHelpers\AssertExtensions.cs (1)
11public static void Equal(byte[] expected, Span<byte> actual)
VariableIntHelperTests.cs (1)
25var outputBuffer = new Span<byte>(new byte[8]);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (33)
Http1ConnectionBenchmark.cs (1)
111public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine)
HttpParserBenchmark.cs (2)
101public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine) 138public void OnStartLine(HttpVersionAndMethod versionAndMethod, TargetOffsetPathLength targetPath, Span<byte> startLine)
KnownStringsBenchmark.cs (9)
30Span<byte> data = _methodGet; 38Span<byte> data = _methodConnect; 46Span<byte> data = _methodDelete; 53Span<byte> data = _methodHead; 61Span<byte> data = _methodPatch; 68Span<byte> data = _methodPost; 75Span<byte> data = _methodPut; 83Span<byte> data = _methodOptions; 91Span<byte> data = _methodTrace;
Mocks\NullParser.cs (1)
36Span<byte> startLine = _startLine;
Mocks\NullPipeWriter.cs (1)
38public override Span<byte> GetSpan(int sizeHint = 0)
ResponseHeadersWritingBenchmark.cs (1)
201public override Span<byte> GetSpan(int sizeHint = 0) => _memory.Span;
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = 0)
src\Servers\Kestrel\shared\HPackHeaderWriter.cs (5)
20public static bool BeginEncodeHeaders(int statusCode, DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 51public static bool BeginEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 74public static bool ContinueEncodeHeaders(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, out int length) 79private static bool EncodeStatusHeader(int statusCode, DynamicHPackEncoder hpackEncoder, Span<byte> buffer, out int length) 94private static bool EncodeHeadersCore(DynamicHPackEncoder hpackEncoder, Http2HeadersEnumerator headersEnumerator, Span<byte> buffer, bool throwIfNoneEncoded, out int length)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (5)
722await SendAsync(Span<byte>.Empty); 779_headerHandler.DecodedHeaders[((Span<byte>)knownHeader.Name).GetAsciiStringNonNullCharacters()] = HttpUtilities.GetAsciiOrUTF8StringNonNullCharacters((ReadOnlySpan<byte>)knownHeader.Value); 784_headerHandler.DecodedHeaders[((Span<byte>)H3StaticTable.Get(index).Name).GetAsciiStringNonNullCharacters()] = value.GetAsciiOrUTF8StringNonNullCharacters(); 869var buffer = pw.GetSpan(sizeHint: 8); 907internal static void WriteSettings(List<Http3PeerSetting> settings, Span<byte> destination)
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (2)
35var buffer = headerEncodingBuffer.AsSpan(); 69public static void WriteStartStream(this PipeWriter writer, int streamId, Span<byte> headerData, bool endStream, Http2Frame frame = null)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
99public override Span<byte> GetSpan()
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
53Span<byte> alloc = GetSpan(toAlloc, out bool mustCommit); 71public Span<T> AllocAsSpan<T>(int count) where T : unmanaged 89Span<byte> buffer = GetSpan(maxAlloc, out bool mustCommit); 117private Span<byte> GetSpan(int sizeHint, out bool mustCommit)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (5)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
99public override Span<byte> GetSpan()
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
53Span<byte> alloc = GetSpan(toAlloc, out bool mustCommit); 71public Span<T> AllocAsSpan<T>(int count) where T : unmanaged 89Span<byte> buffer = GetSpan(maxAlloc, out bool mustCommit); 117private Span<byte> GetSpan(int sizeHint, out bool mustCommit)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (10)
src\Servers\Kestrel\shared\CompletionPipeWriter.cs (1)
62public override Span<byte> GetSpan(int sizeHint = 0)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
99public override Span<byte> GetSpan()
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
53Span<byte> alloc = GetSpan(toAlloc, out bool mustCommit); 71public Span<T> AllocAsSpan<T>(int count) where T : unmanaged 89Span<byte> buffer = GetSpan(maxAlloc, out bool mustCommit); 117private Span<byte> GetSpan(int sizeHint, out bool mustCommit)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (5)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
99public override Span<byte> GetSpan()
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
53Span<byte> alloc = GetSpan(toAlloc, out bool mustCommit); 71public Span<T> AllocAsSpan<T>(int count) where T : unmanaged 89Span<byte> buffer = GetSpan(maxAlloc, out bool mustCommit); 117private Span<byte> GetSpan(int sizeHint, out bool mustCommit)
Microsoft.AspNetCore.Session (1)
SessionMiddleware.cs (1)
73Span<byte> guidBytes = stackalloc byte[16];
Microsoft.AspNetCore.Shared.Tests (107)
PropertyHelperTest.cs (1)
740public Span<bool> Span => throw new NotImplementedException();
runtime\Http2\HPackIntegerTest.cs (3)
16Span<byte> actualResult = new byte[64]; 28Span<byte> actualResult = new byte[expectedResult.Length - 1]; 58Span<byte> integerBytes = stackalloc byte[5];
runtime\Http3\QPackDecoderTest.cs (2)
165Span<byte> buffer = new byte[1024 * 1024]; 346Span<byte> chunk = encoded.AsSpan(i, resolvedSize);
runtime\Http3\VariableLengthIntegerHelperTests.cs (8)
252Span<byte> span = new Span<byte>(); 267Span<byte> span = new Span<byte>(new byte[1]); 283Span<byte> span = new Span<byte>(new byte[2]); 296Span<byte> span = new Span<byte>(new byte[1]); 311Span<byte> span = new Span<byte>(new byte[4]); 324Span<byte> span = new Span<byte>(new byte[1]); 339Span<byte> span = new Span<byte>(new byte[8]); 352Span<byte> span = new Span<byte>(new byte[1]);
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
540private Span<KeyValuePair<TKey, TValue>> ArrayStorageSpan
src\Shared\Hpack\DynamicHPackEncoder.cs (3)
54public bool EnsureDynamicTableSizeUpdate(Span<byte> buffer, out int length) 68public bool EncodeHeader(Span<byte> buffer, int staticTableIndex, HeaderEncodingHint encodingHint, string name, string value, 117private bool EncodeDynamicHeader(Span<byte> buffer, int staticTableIndex, string name, string value,
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (4)
274internal Span<byte> GetRawUrlInBytes() 501internal void GetUnknownKeys(Span<string> destination) 518private void PopulateUnknownKeys(HTTP_REQUEST_V1* request, long fixup, Span<string> destination) 831public override Span<T> GetSpan()
src\Shared\HttpSys\RequestProcessing\PathNormalizer.cs (1)
14public static unsafe int RemoveDotSegments(Span<byte> input)
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (4)
11public static Span<byte> GetPath(Span<byte> raw) 73private static int FindHttpOrHttps(Span<byte> raw) 133private static int Find(Span<byte> raw, int begin, byte target)
src\Shared\HttpSys\RequestProcessing\RequestHeaders.cs (1)
278private int GetKnownHeadersKeys(Span<string> observedHeaders)
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (7)
20public static string DecodeAndUnescapePath(Span<byte> rawUrlBytes) 23var rawPath = RawUrlHelper.GetPath(rawUrlBytes); 37var unescapedPath = Unescape(rawPath); 49private static Span<byte> Unescape(Span<byte> rawPath) 101private static bool DecodeCore(ref int reader, ref int writer, int end, Span<byte> buffer) 237private static void Copy(int begin, int end, ref int writer, Span<byte> buffer)
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\Shared\runtime\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
41public static bool TryWriteFrameEnvelope(Http3FrameType frameType, long payloadLength, Span<byte> buffer, out int bytesWritten)
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (3)
114Span<byte> temp = (stackalloc byte[8])[..length]; 147public static bool TryWrite(Span<byte> buffer, long longToEncode, out int bytesWritten) 190public static int WriteInteger(Span<byte> buffer, long longToEncode)
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (18)
23public static bool EncodeStaticIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 39Span<byte> buffer = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; 61public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Span<byte> destination, out int bytesWritten) 66public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 89/// Encodes just the name part of a Literal Header Field With Static Name Reference. Must call <see cref="EncodeValueString(string, Encoding?, Span{byte}, out int)"/> after to encode the header's value. 93Span<byte> temp = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; 104Span<byte> temp = value.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; 125public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Span<byte> destination, out int bytesWritten) 130public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 147public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 160/// Encodes just the value part of a Literawl Header Field Without Static Name Reference. Must call <see cref="EncodeValueString(string, Encoding?, Span{byte}, out int)"/> after to encode the header's value. 164Span<byte> temp = name.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength] : new byte[name.Length + IntegerEncoder.MaxInt32EncodedLength]; 174Span<byte> temp = (name.Length + value.Length) < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[name.Length + value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; 182private static bool EncodeValueString(string s, Encoding? valueEncoding, Span<byte> buffer, out int length) 220public static bool EncodeValueString(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> buffer, out int length) 301private static void EncodeValueStringPart(string s, Span<byte> buffer) 316private static bool EncodeNameString(string s, Span<byte> buffer, out int length) 355private static bool EncodeHeaderBlockPrefix(Span<byte> destination, out int bytesWritten)
src\Shared\ServerInfrastructure\BufferExtensions.cs (4)
117var dest = buffer.Span; 136var span = buffer.Span; 209var dest = buffer.Span; 231var bytes = buffer.Span;
src\Shared\ServerInfrastructure\BufferWriter.cs (2)
23private Span<byte> _span; 52public readonly Span<byte> Span => _span;
src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (3)
22public static void WriteUInt24BigEndian(Span<byte> destination, uint value) 39public static void WriteUInt31BigEndian(Span<byte> destination, uint value) 43public static void WriteUInt31BigEndian(Span<byte> destination, uint value, bool preserveHighestBit)
src\Shared\ServerInfrastructure\StringUtilities.cs (4)
53private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiOrUTF8StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 80private static readonly unsafe SpanAction<char, IntPtr> s_getAsciiStringNonNullCharacters = (Span<char> buffer, IntPtr state) => 106private static readonly unsafe SpanAction<char, IntPtr> s_getLatin1StringNonNullCharacters = (Span<char> buffer, IntPtr state) => 482private static readonly SpanAction<char, (string? str, char separator, uint number)> s_populateSpanWithHexSuffix = (Span<char> buffer, (string? str, char separator, uint number) tuple) =>
src\Shared\UrlDecoder\UrlDecoder.cs (11)
18public static int DecodeRequestLine(ReadOnlySpan<byte> source, Span<byte> destination, bool isFormEncoding) 42public static int DecodeInPlace(Span<byte> buffer, bool isFormEncoding) 96private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<byte> buffer, bool isFormEncoding) 234private static void Copy<T>(int begin, int end, ref int writer, Span<T> buffer) 262private static int UnescapePercentEncoding(ref int scan, Span<byte> buffer, bool isFormEncoding) 301private static int ReadHex(ref int scan, Span<byte> buffer) 355/// Form Encoding is not supported compared to the <see cref="DecodeRequestLine(ReadOnlySpan{byte}, Span{byte}, bool)" /> 358public static int DecodeRequestLine(ReadOnlySpan<char> source, Span<char> destination) 374/// Form Encoding is not supported compared to the <see cref="DecodeInPlace(Span{byte}, bool)" /> 377public static int DecodeInPlace(Span<char> buffer) 434private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<char> buffer)
src\Shared\WebEncoders\WebEncoders.cs (2)
327Span<char> buffer = bufferSize <= StackAllocThreshold 342private static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
758Span<bool> isStreaming = args.Length <= MaxStackSize
Microsoft.AspNetCore.SignalR.Client.Tests (3)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
Microsoft.AspNetCore.SignalR.Common (7)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
111var destination = GetBuffer(); 140private Span<byte> GetBuffer() 172var destination = GetBuffer();
Microsoft.AspNetCore.SignalR.Common.Tests (3)
Internal\Protocol\Utf8BufferTextWriterTests.cs (1)
384public Span<byte> GetSpan(int sizeHint = 0)
src\SignalR\common\Shared\BinaryMessageFormatter.cs (2)
13Span<byte> lenBuffer = stackalloc byte[5]; 20public static int WriteLengthPrefix(long length, Span<byte> output)
Microsoft.AspNetCore.SignalR.Core (1)
Internal\Utf8HashLookup.cs (1)
82var chars = count <= StackAllocThreshold ?
Microsoft.AspNetCore.SignalR.Microbenchmarks (4)
Shared\TestPipeWriter.cs (1)
24public override Span<byte> GetSpan(int sizeHint = 0)
src\SignalR\common\Shared\BinaryMessageFormatter.cs (2)
13Span<byte> lenBuffer = stackalloc byte[5]; 20public static int WriteLengthPrefix(long length, Span<byte> output)
src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
Microsoft.AspNetCore.SignalR.Protocols.Json (5)
src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
111var destination = GetBuffer(); 140private Span<byte> GetBuffer() 172var destination = GetBuffer();
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (5)
Protocol\MessagePackHubProtocolWorker.cs (1)
372var span = array.AsSpan();
src\SignalR\common\Shared\BinaryMessageFormatter.cs (2)
13Span<byte> lenBuffer = stackalloc byte[5]; 20public static int WriteLengthPrefix(long length, Span<byte> output)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (7)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
src\SignalR\common\Shared\TextMessageFormatter.cs (1)
16var buffer = output.GetSpan(1);
src\SignalR\common\Shared\Utf8BufferTextReader.cs (1)
76var destination = new Span<char>(buffer, index, count);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (3)
111var destination = GetBuffer(); 140private Span<byte> GetBuffer() 172var destination = GetBuffer();
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (4)
RedisHubLifetimeManager.cs (2)
819Span<byte> buffer = stackalloc byte[16]; 823Span<char> base64 = stackalloc char[24];
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
116public Span<byte> GetSpan(int sizeHint = 0) 247public void CopyTo(Span<byte> span)
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
401private static PreconditionState GetMaxPreconditionState(params Span<PreconditionState> states)
Microsoft.AspNetCore.StaticAssets.Tests (1)
StaticAssetsIntegrationTests.cs (1)
263private static void CreateTestManifest(string appName, string webRoot, params Span<TestResource> resources)
Microsoft.AspNetCore.TestHost (1)
ResponseBodyPipeWriter.cs (1)
93public override Span<byte> GetSpan(int sizeHint = 0)
Microsoft.AspNetCore.WebSockets (15)
HandshakeHelpers.cs (5)
46Span<byte> temp = stackalloc byte[16]; 60Span<byte> mergedBytes = stackalloc byte[60]; 64Span<byte> hashedBytes = stackalloc byte[20]; 173var span = builder.AppendSpan(len); 268var span = builder.AppendSpan(len);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (3)
15private Span<T> _span; 19public ValueListBuilder(Span<T> initialSpan) 32Span<T> span = _span;
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (7)
15private Span<char> _chars; 18public ValueStringBuilder(Span<char> initialBuffer) 99public Span<char> RawChars => _chars; 119public bool TryCopyTo(Span<char> destination, out int charsWritten) 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 259public Span<char> AppendSpan(int length)
Microsoft.AspNetCore.WebUtilities (22)
FileBufferingReadStream.cs (1)
257public override int Read(Span<byte> buffer)
FormPipeReader.cs (3)
354Span<byte> buffer = stackalloc byte[StackAllocThreshold].Slice(0, (int)ros.Length); 364Span<byte> buffer = byteArray.AsSpan(0, (int)ros.Length); 398var span = MemoryMarshal.CreateSpan(ref MemoryMarshal.GetReference(readOnlySpan), readOnlySpan.Length);
HttpRequestStreamReader.cs (3)
163var span = new Span<char>(buffer, index, count); 168public override int Read(Span<char> buffer) 396var span = new Span<char>(_charBuffer, _charBufferIndex, _charsRead - _charBufferIndex);
HttpResponseStreamWriter.cs (1)
663var destination = new Span<char>(_charBuffer, _charBufferCount, remaining);
MultipartReaderStream.cs (1)
177var slice = buffer.AsSpan(0, Math.Min(buffer.Length, index));
src\Shared\UrlDecoder\UrlDecoder.cs (11)
18public static int DecodeRequestLine(ReadOnlySpan<byte> source, Span<byte> destination, bool isFormEncoding) 42public static int DecodeInPlace(Span<byte> buffer, bool isFormEncoding) 96private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<byte> buffer, bool isFormEncoding) 234private static void Copy<T>(int begin, int end, ref int writer, Span<T> buffer) 262private static int UnescapePercentEncoding(ref int scan, Span<byte> buffer, bool isFormEncoding) 301private static int ReadHex(ref int scan, Span<byte> buffer) 355/// Form Encoding is not supported compared to the <see cref="DecodeRequestLine(ReadOnlySpan{byte}, Span{byte}, bool)" /> 358public static int DecodeRequestLine(ReadOnlySpan<char> source, Span<char> destination) 374/// Form Encoding is not supported compared to the <see cref="DecodeInPlace(Span{byte}, bool)" /> 377public static int DecodeInPlace(Span<char> buffer) 434private static bool DecodeCore(ref int sourceIndex, ref int destinationIndex, Span<char> buffer)
src\Shared\WebEncoders\WebEncoders.cs (2)
327Span<char> buffer = bufferSize <= StackAllocThreshold 342private static int Base64UrlEncode(ReadOnlySpan<byte> input, Span<char> output)
Microsoft.AspNetCore.WebUtilities.Tests (2)
HttpRequestStreamReaderTest.cs (2)
272var span = new Span<char>(chars); 291var span = new Span<char>(chars);
Microsoft.Build (12)
FileUtilities.cs (8)
572Span<char> newValue = ConvertToUnixSlashes(value.ToCharArray()); 604Span<char> newValue = ConvertToUnixSlashes(value.ToArray()); 611private static Span<char> ConvertToUnixSlashes(Span<char> path) 617private static Span<char> CollapseSlashes(Span<char> str) 637private static Span<char> RemoveQuotes(Span<char> path)
Logging\OptimizedStringIndenter.cs (4)
62Span<StringSegment> segments = GetStringSegments(s.AsSpan(), stackalloc StringSegment[128], out StringSegment[]? pooledArray); 75foreach (StringSegment segment in *(Span<StringSegment>*)state.Item2) 113private static Span<StringSegment> GetStringSegments(ReadOnlySpan<char> input, Span<StringSegment> segments, out StringSegment[]? pooledArray)
Microsoft.Build.Engine.OM.UnitTests (8)
FileUtilities.cs (8)
572Span<char> newValue = ConvertToUnixSlashes(value.ToCharArray()); 604Span<char> newValue = ConvertToUnixSlashes(value.ToArray()); 611private static Span<char> ConvertToUnixSlashes(Span<char> path) 617private static Span<char> CollapseSlashes(Span<char> str) 637private static Span<char> RemoveQuotes(Span<char> path)
Microsoft.Build.Framework (19)
ArraySortHelper.cs (19)
310int nanLeft = SegmentedArraySortUtils.MoveNansToFront(keys, default(Span<byte>)); 669public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 687private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 707private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 720internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 731private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 777private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 822private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 840private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, int lo, IComparer<TKey> comparer) 869private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 895public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 942private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 960private static void Swap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int j) 973private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit) 1018private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1077private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1094private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, int lo) 1122private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values) 1235public static int MoveNansToFront<TKey, TValue>(SegmentedArraySegment<TKey> keys, Span<TValue> values) where TKey : notnull
Microsoft.Build.Tasks.Core (8)
FileUtilities.cs (8)
572Span<char> newValue = ConvertToUnixSlashes(value.ToCharArray()); 604Span<char> newValue = ConvertToUnixSlashes(value.ToArray()); 611private static Span<char> ConvertToUnixSlashes(Span<char> path) 617private static Span<char> CollapseSlashes(Span<char> str) 637private static Span<char> RemoveQuotes(Span<char> path)
Microsoft.Build.Utilities.Core (8)
FileUtilities.cs (8)
572Span<char> newValue = ConvertToUnixSlashes(value.ToCharArray()); 604Span<char> newValue = ConvertToUnixSlashes(value.ToArray()); 611private static Span<char> ConvertToUnixSlashes(Span<char> path) 617private static Span<char> CollapseSlashes(Span<char> str) 637private static Span<char> RemoveQuotes(Span<char> path)
Microsoft.Extensions.Caching.Hybrid (1)
Internal\RecyclableArrayBufferWriter.cs (1)
141public Span<T> GetSpan(int sizeHint = 0)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
DistributedCacheTests.cs (1)
366public override Span<byte> GetSpan() => new(_data, 5, _data.Length - 10);
Microsoft.Extensions.Caching.MicroBenchmarks (1)
src\Caching\Hybrid\src\Internal\RecyclableArrayBufferWriter.cs (1)
141public Span<T> GetSpan(int sizeHint = 0)
Microsoft.Extensions.DependencyInjection.Abstractions (6)
ActivatorUtilities.cs (6)
72Span<object?> values = maxArgs <= StackAllocatedObjects.MaxStackAllocArgCount / 2 ? 76Span<object?> ctorArgs = values.Slice(0, maxArgs); 77Span<object?> bestCtorArgs = values.Slice(maxArgs, maxArgs); 206static void InitializeCtorArgValues(ref Span<object?> ctorArgs, int _) 805private readonly Span<object?> _parameterValues; 806public ConstructorMatcher(ConstructorInfoEx constructor, Span<object?> parameterValues)
Microsoft.Extensions.Diagnostics (2)
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (2)
121private Span<ulong> _bitMap; 123public BitMapper(Span<ulong> bitMap)
Microsoft.Extensions.Identity.Core (3)
Base32.cs (1)
118private static int GetNextGroup(Span<byte> input, ref int offset, out byte a, out byte b, out byte c, out byte d, out byte e, out byte f, out byte g, out byte h)
Rfc6238AuthenticationService.cs (1)
70private static byte[] ApplyModifier(Span<byte> input, byte[] modifierBytes)
UserManager.cs (1)
2076Span<uint> resultBuffer = stackalloc uint[1];
Microsoft.Extensions.Logging.Abstractions (8)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
Microsoft.Extensions.Logging.Console (3)
SimpleConsoleFormatter.cs (1)
94Span<char> span = stackalloc char[10];
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (2)
144public Span<byte> GetSpan(int sizeHint = MinimumBufferSize) 211Span<byte> oldBufferAsSpan = oldBuffer.AsSpan(0, _index);
Microsoft.Extensions.Logging.Generators (16)
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithMetadataName.cs (2)
126using var result = new ValueListBuilder<T>(Span<T>.Empty); 163var result = new ValueListBuilder<AttributeData>(Span<AttributeData>.Empty);
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithSimpleName.cs (6)
162var globalAliases = new Aliases(Span<(string aliasName, string symbolName)>.Empty); 206var localAliases = new Aliases(Span<(string, string)>.Empty); 212var seenNames = new ValueListBuilder<string>(Span<string>.Empty); 213var results = new ValueListBuilder<SyntaxNode>(Span<SyntaxNode>.Empty); 214var attributeTargets = new ValueListBuilder<SyntaxNode>(Span<SyntaxNode>.Empty); 297var nodeStack = new ValueListBuilder<SyntaxNode>(Span<SyntaxNode>.Empty);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T> initialSpan) 49Span<T> span = _span; 65Span<T> span = _span; 104public Span<T> AppendSpan(int length) 109Span<T> span = _span; 122private Span<T> AppendSpanWithGrow(int length) 146public bool TryCopyTo(Span<T> destination, out int itemsWritten)
Microsoft.Net.Http.Headers (4)
ContentDispositionHeaderValue.cs (2)
550Span<byte> buffer = requiredLength <= MaxStackAllocSizeBytes 556var bufferContent = buffer.Slice(MimePrefix.Length);
SetCookieHeaderValue.cs (2)
312private static void AppendSegment(ref Span<char> span, StringSegment name, StringSegment value) 323private static void Append(ref Span<char> span, ReadOnlySpan<char> other)
Microsoft.NET.WebAssembly.Webcil (1)
WebcilConverter.cs (1)
260private static void ReadExactly(FileStream s, Span<byte> buffer)
MSBuild (8)
FileUtilities.cs (8)
572Span<char> newValue = ConvertToUnixSlashes(value.ToCharArray()); 604Span<char> newValue = ConvertToUnixSlashes(value.ToArray()); 611private static Span<char> ConvertToUnixSlashes(Span<char> path) 617private static Span<char> CollapseSlashes(Span<char> str) 637private static Span<char> RemoveQuotes(Span<char> path)
mscorlib (1)
mscorlib.cs (1)
31[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
netstandard (1)
netstandard.cs (1)
2015[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
PresentationCore (3)
MS\Internal\TextFormatting\NumberSubstitution.cs (1)
505Span<char> twoChars = stackalloc char[2];
System\Windows\Media\StreamAsIStream.cs (2)
293public int Read(Span<byte> buffer, out uint cbRead) 602var span = new Span<byte>(buffer.ToPointer(), (int) cb);
ReachFramework (1)
Serialization\XpsFontSubsetter.cs (1)
690Span<byte> guidByteArray = stackalloc byte[16];
Sockets.FunctionalTests (2)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
58public override Span<byte> GetSpan(int sizeHint = 0) => _output.GetSpan(sizeHint);
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (1)
168public override Span<byte> GetSpan(int sizeHint = 0)
System.Collections (7)
src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (4)
11private readonly Span<int> _span; 13internal BitHelper(Span<int> span, bool clear) 29Span<int> span = _span; 43Span<int> span = _span;
System\Collections\BitArray.cs (2)
289Span<int> span = m_array.AsSpan(0, arrayLength); 790Span<byte> span = byteArray.AsSpan(index);
System\Collections\Generic\SortedSet.cs (1)
1391Span<int> span = stackalloc int[StackAllocThreshold];
System.Collections.Immutable (20)
System\Collections\Frozen\FrozenDictionary.cs (1)
330public void CopyTo(Span<KeyValuePair<TKey, TValue>> destination)
System\Collections\Frozen\FrozenHashTable.cs (3)
47public static FrozenHashTable Create(Span<int> hashCodes, bool hashCodesAreUnique = false) 60Span<int> bucketStarts = arrayPoolBuckets.AsSpan(0, numBuckets); 61Span<int> nexts = arrayPoolBuckets.AsSpan(numBuckets, hashCodes.Length);
System\Collections\Frozen\FrozenSet.cs (1)
244public void CopyTo(Span<T> destination) =>
System\Collections\Frozen\FrozenSetInternalBase.cs (1)
198Span<int> seenItems = intArrayLength <= 128 ?
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (1)
32Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length);
System\Collections\Frozen\ItemsFrozenSet.cs (1)
27Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length);
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (1)
29Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length);
System\Collections\Frozen\String\OrdinalStringFrozenDictionary.cs (1)
44Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, keys.Length);
System\Collections\Frozen\String\OrdinalStringFrozenSet.cs (1)
35Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length);
System\Collections\Immutable\ImmutableArray.cs (2)
107public static ImmutableArray<T> Create<T>(Span<T> items) 129public static ImmutableArray<T> ToImmutableArray<T>(this Span<T> items)
System\Collections\Immutable\ImmutableArray_1.Builder.cs (4)
451var elements = new Span<T>(_elements, offset, items.Length); 1012/// Copies the current contents to the specified <see cref="Span{T}"/>. 1014/// <param name="destination">The <see cref="Span{T}"/> to copy to.</param> 1015public void CopyTo(Span<T> destination)
System\Collections\Immutable\ImmutableArray_1.cs (3)
909/// Copies the elements of current <see cref="ImmutableArray{T}"/> to an <see cref="Span{T}"/>. 911/// <param name="destination">The <see cref="Span{T}"/> that is the destination of the elements copied from current <see cref="ImmutableArray{T}"/>.</param> 912public void CopyTo(Span<T> destination)
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\Base64StringAttribute.cs (1)
13/// using the <see cref="Convert.TryFromBase64String(string, Span{byte}, out int)"/> method.
System.ComponentModel.TypeConverter (2)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
61Span<Range> tokens = stackalloc Range[5];
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (1)
91public override int Read(Span<byte> buffer)
System.Console (22)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
System\ConsolePal.Unix.ConsoleStream.cs (1)
42public override int Read(Span<byte> buffer) =>
System\ConsolePal.Unix.cs (4)
466Span<byte> readBytes = stackalloc byte[256]; 569static unsafe bool BufferUntil(byte toFind, ref Span<byte> dst, ref int dstPos, out int foundPos) 602static unsafe bool AppendToStdInReaderUntil(byte toFind, StdInReader reader, Span<byte> foundByteDst, ref int foundByteDstPos, out int foundPos) 948private static unsafe int Read(SafeFileHandle fd, Span<byte> buffer)
System\IO\CachedConsoleStream.cs (4)
23public override int Read(Span<byte> buffer) => throw Error.GetReadNotSupported(); 29Span<char> charSpan = maxCharCount <= 512 ? stackalloc char[512] : (pooledBuffer = ArrayPool<char>.Shared.Rent(maxCharCount)); 49private static void WriteOrCache(CachedConsoleStream stream, StringBuilder cache, Span<char> charBuffer) 54Span<char> lineSpan = charBuffer.Slice(0, lastNewLine);
System\IO\StdInReader.cs (3)
62Span<char> chars = (uint)maxCharsCount <= MaxStackAllocation ? 107public int ReadLine(Span<byte> buffer) 381Span<byte> bytes = stackalloc byte[32]; // 32 bytes seems ample
System\IO\SyncTextReader.Unix.cs (1)
43public int ReadLine(Span<byte> buffer) => Inner.ReadLine(buffer);
System\TermInfo.DatabaseFactory.cs (1)
110Span<char> stackBuffer = stackalloc char[256];
System.Data.Common (35)
System\Data\SQLTypes\SQLBytes.cs (6)
284internal long Read(long offset, Span<byte> buffer) 316private long ReadNoValidation(long offset, Span<byte> buffer) 328Span<byte> span = _rgbBuf!.AsSpan((int)offset, count); 422Span<byte> span = _rgbBuf.AsSpan((int)offset, buffer.Length); 720public override int Read(Span<byte> buffer) 736private int ReadNoValidation(Span<byte> buffer)
System\Data\SQLTypes\SQLDecimal.cs (25)
493Span<int> bits = stackalloc int[4]; 930Span<uint> rgulNumeric = [_data1, _data2, _data3, _data4]; 932Span<char> pszTmp = stackalloc char[s_NUMERIC_MAX_PRECISION + 1]; //Local Character buffer to hold 1158public int WriteTdsValue(Span<uint> destination) 1289Span<uint> rglData1 = [x._data1, x._data2, x._data3, x._data4]; 1290Span<uint> rglData2 = [y._data1, y._data2, y._data3, y._data4]; 1338Span<uint> rguiTemp = rglData2; 1481Span<uint> rgulRes = stackalloc uint[x_culNumeMultRes]; //new [] are already initialized to zero 1709Span<uint> rgulData1 = [x._data1, x._data2, x._data3, x._data4]; 1710Span<uint> rgulData2 = [y._data1, y._data2, y._data3, y._data4]; 1713Span<uint> rgulR = stackalloc uint[s_cNumeMax + 1]; 1714Span<uint> rgulQ = stackalloc uint[s_cNumeMax]; 1857private static void ZeroToMaxLen(Span<uint> rgulData, int cUI4sCur) 1931private static bool FGt10_38(Span<uint> rglData) 2088Span<uint> rgulU = [_data1, _data2, _data3, _data4]; 2119Span<uint> rguiData = [_data1, _data2, _data3, _data4]; 2164Span<uint> rguiData = [_data1, _data2, _data3, _data4]; 2224Span<uint> rguiData = [_data1, _data2, _data3, _data4]; 2458Span<uint> rgulD, // Out | Destination number 2474Span<uint> rgulD, // Out | Number 2499Span<uint> piulD, // InOut| D 2531Span<uint> rgulU, // InOut| U 2595Span<uint> rgulD, // InOut | D 2597Span<uint> rgulQ, // Out | Q 2599Span<uint> rgulR, // Out | R
System\Data\SQLTypes\SQLGuid.cs (2)
122Span<byte> xBytes = stackalloc byte[SizeOfGuid]; 126Span<byte> yBytes = stackalloc byte[SizeOfGuid];
System\Data\SQLTypes\SqlXml.cs (1)
414public override int Read(Span<byte> buffer)
System\Data\XDRSchema.cs (1)
301Span<System.Range> parts = stackalloc System.Range[3];
System.Diagnostics.DiagnosticSource (38)
src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (2)
121private Span<ulong> _bitMap; 123public BitMapper(Span<ulong> bitMap)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
System\Diagnostics\Activity.cs (8)
226Span<char> flagsChars = stackalloc char[2]; 258Span<char> flagsChars = stackalloc char[2]; 1795Span<byte> span = stackalloc byte[sizeof(ulong) * 2]; 1865Span<ulong> span = stackalloc ulong[2]; 1897public void CopyTo(Span<byte> destination) 1906internal static unsafe void SetToRandomBytes(Span<byte> outBytes) 1923internal static void SetSpanFromHexChars(ReadOnlySpan<char> charData, Span<byte> outBytes) 2079public void CopyTo(Span<byte> destination)
System\Diagnostics\Activity.GenerateRootId.netcoreapp.cs (1)
17Span<char> result = stackalloc char[1 + 16 + s_uniqSuffix.Length]; // max length needed
System\Diagnostics\Metrics\AggregatorStore.cs (3)
449Span<object?> indexedValues = values.AsSpan(); 491Span<string> indexedNames = kvName.Key.AsSpan(); 498Span<object?> indexedValues = kvValue.Key.AsSpan();
System\Diagnostics\Metrics\ObjectSequence.netcore.cs (5)
11Span<object?> AsSpan(); 16public Span<object?> AsSpan() 24public Span<object?> AsSpan() 34public Span<object?> AsSpan() 45public Span<object?> AsSpan()
System\Diagnostics\Metrics\StringSequence.cs (1)
87public Span<string> AsSpan() =>
System\Diagnostics\Metrics\StringSequence.netcore.cs (4)
11Span<string> AsSpan(); 17public Span<string> AsSpan() 25public Span<string> AsSpan() 35public Span<string> AsSpan()
System\Diagnostics\Metrics\TagList.cs (1)
225public readonly void CopyTo(Span<KeyValuePair<string, object?>> tags)
System.Diagnostics.FileVersionInfo (1)
System\Diagnostics\FileVersionInfo.Unix.cs (1)
204Span<Range> parts = stackalloc Range[5];
System.Diagnostics.Process (18)
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (1)
419Span<Range> lineParts = stackalloc Range[4];
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetGroupList.cs (1)
19Span<uint> groups = stackalloc uint[InitialGroupsLength];
src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (1)
24Span<uint> groups = stackalloc uint[InitialGroupsLength];
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
38Span<byte> spanBuffer = stackalloc byte[StackBufferSize];
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (3)
16private Span<byte> _bytes; 18public ValueUtf8Converter(Span<byte> initialBuffer) 24public Span<byte> ConvertAndTerminateString(ReadOnlySpan<char> value)
System\Diagnostics\Process.Linux.cs (3)
272Span<byte> buffer = stackalloc byte[512]; 299Span<byte> argRemainder = buffer.Slice(0, bytesRead); 339static string? GetUntruncatedNameFromArg(Span<byte> arg, string prefix)
System.Diagnostics.TextWriterTraceListener (3)
System\Diagnostics\XmlWriterTraceListener.cs (3)
397Span<char> span = stackalloc char[20]; // max length of longest formatted long with invariant culture 409Span<char> span = stackalloc char[38]; // length of a Guid formatted as "B" 421Span<char> span = stackalloc char[33]; // max length of a DateTime formatted as "o"
System.Diagnostics.TraceSource (1)
System\Diagnostics\TraceListener.cs (1)
419Span<char> stackBuffer = stackalloc char[128];
System.Drawing.Primitives (1)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
61Span<Range> tokens = stackalloc Range[5];
System.Formats.Asn1 (58)
System\Formats\Asn1\Asn1Tag.cs (5)
269/// <seealso cref="TryEncode(Span{byte},out int)"/> 301/// <see langword="false"/> if <paramref name="destination"/>.<see cref="Span{T}.Length"/> &lt; 304public bool TryEncode(Span<byte> destination, out int bytesWritten) 360/// <paramref name="destination"/>.<see cref="Span{T}.Length"/> &lt; <see cref="CalculateEncodedSize"/>. 362public int Encode(Span<byte> destination)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (9)
52internal static int GetBytes(this Encoding encoding, ReadOnlySpan<char> chars, Span<byte> bytes) 84protected abstract int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool write); 85protected abstract int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool write); 108return GetBytes(chars, Span<byte>.Empty, write: false); 143return GetChars(bytes, Span<char>.Empty, write: false); 254protected override int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool write) 282protected override int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool write) 321protected override int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool write) 356protected override int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool write)
System\Formats\Asn1\AsnDecoder.BitString.cs (11)
158Span<byte> destination, 397Span<byte> destination); 402Span<byte> destination) 419Span<byte> destination = Span<byte>.Empty; 434Span<byte> destination, 440Span<byte> tmpDest = destination; 455Span<byte> destination, 469Span<byte> curDest = destination; 590Span<byte> dest, 782Span<byte> destination,
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (1)
59Span<byte> tmpSpace = stackalloc byte[StackBufSize];
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (3)
198Span<byte> stackSpan = stackalloc byte[sizeof(ulong)]; 353Span<byte> valueSpan = rented.AsSpan(0, written); 393internal static void ReverseBitsPerByte(Span<byte> value)
System\Formats\Asn1\AsnDecoder.OctetString.cs (8)
63Span<byte> destination, 293Span<byte>.Empty, 310Span<byte> destination, 327Span<byte> destination, 339Span<byte> curDest = destination; 455Span<byte> dest, 483Span<byte> tmpSpace = default) 573Span<byte> destination,
System\Formats\Asn1\AsnDecoder.Oid.cs (2)
145Span<byte> writeSpan = tmpBytes; 146Span<byte> accumValueBytes = stackalloc byte[sizeof(long)];
System\Formats\Asn1\AsnDecoder.Text.cs (7)
147Span<byte> destination, 244Span<char> destination, 339Span<byte> destination, 389Span<char> destination, 486Span<char> destination, 647Span<byte> destination, 715Span<char> destination,
System\Formats\Asn1\AsnDecoder.UtcTime.cs (1)
83Span<byte> tmpSpace = stackalloc byte[17];
System\Formats\Asn1\AsnWriter.BitString.cs (1)
161Span<byte> dest;
System\Formats\Asn1\AsnWriter.cs (3)
127public bool TryEncode(Span<byte> destination, out int bytesWritten) 162public int Encode(Span<byte> destination) 558Span<byte> dest = _buffer.AsSpan(start + requiredPadding, containedLength);
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (1)
121Span<byte> baseSpan = _buffer.AsSpan(_offset);
System\Formats\Asn1\AsnWriter.NamedBitList.cs (2)
137Span<byte> temp = stackalloc byte[sizeof(ulong)]; 195Span<byte> valueSpan = rented.AsSpan(0, requiredBytes);
System\Formats\Asn1\AsnWriter.OctetString.cs (1)
141Span<byte> dest;
System\Formats\Asn1\AsnWriter.Oid.cs (1)
191private static int EncodeSubIdentifier(Span<byte> dest, ref BigInteger subIdentifier)
System\Formats\Asn1\AsnWriter.Text.cs (1)
102Span<byte> dest = _buffer.AsSpan(_offset, size);
System\Formats\Asn1\AsnWriter.UtcTime.cs (1)
98Span<byte> baseSpan = _buffer.AsSpan(_offset);
System.Formats.Cbor (25)
src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
21public override Span<T> GetSpan()
System\Formats\Cbor\CborHelpers.netcoreapp.cs (5)
16public static int GetBytes(Encoding encoding, ReadOnlySpan<char> source, Span<byte> destination) 22public static int GetChars(Encoding encoding, ReadOnlySpan<byte> source, Span<char> destination) 37public static void GetBitsFromDecimal(decimal d, Span<int> destination) 56public static unsafe void WriteSingleBigEndian(Span<byte> destination, float value) 60public static unsafe void WriteDoubleBigEndian(Span<byte> destination, double value)
System\Formats\Cbor\Reader\CborReader.String.cs (6)
62public bool TryReadByteString(Span<byte> destination, out int bytesWritten) 218public bool TryReadTextString(Span<char> destination, out int charsWritten) 336Span<byte> target = output; 351private bool TryReadIndefiniteLengthByteStringConcatenated(Span<byte> destination, out int bytesWritten) 397static void BuildString(Span<char> target, (List<(int Offset, int Length)> ranges, ReadOnlyMemory<byte> source, Encoding utf8Encoding) input) 411private bool TryReadIndefiniteLengthTextStringConcatenated(Span<char> destination, out int charsWritten)
System\Formats\Cbor\Writer\CborWriter.Array.cs (1)
83Span<byte> target = _buffer.AsSpan(_frameOffset + bytesToShift, currentOffset - _frameOffset);
System\Formats\Cbor\Writer\CborWriter.cs (2)
188public int Encode(Span<byte> destination) 206public bool TryEncode(Span<byte> destination, out int bytesWritten)
System\Formats\Cbor\Writer\CborWriter.Map.cs (5)
159Span<byte> source = _buffer.AsSpan(); 162Span<byte> tmpSpan = tempBuffer.AsSpan(0, totalMapPayloadEncodingLength); 164Span<byte> s = tmpSpan; 270private Span<byte> GetKeyEncoding((int Offset, int Length) range) 275private Span<byte> GetKeyEncoding(in KeyValuePairEncodingRange range)
System\Formats\Cbor\Writer\CborWriter.String.cs (3)
212Span<byte> buffer = _buffer.AsSpan(); 216Span<byte> tempSpan = tempBuffer.AsSpan(0, definiteLength); 218Span<byte> s = tempSpan;
System\Formats\Cbor\Writer\CborWriter.Tag.cs (2)
149Span<int> buf = stackalloc int[4]; 161Span<int> buf = stackalloc int[4];
System.Formats.Tar (58)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
System\Formats\Tar\SeekableSubReadStream.cs (1)
43public override int Read(Span<byte> destination)
System\Formats\Tar\SubReadStream.cs (1)
105public override int Read(Span<byte> destination)
System\Formats\Tar\TarHeader.Read.cs (13)
24Span<byte> buffer = stackalloc byte[TarHelpers.RecordSize]; 61private static TarHeader? TryReadAttributes(TarEntryFormat initialFormat, Span<byte> buffer) 360private static TarHeader? TryReadCommonAttributes(Span<byte> buffer, TarEntryFormat initialFormat) 365Span<byte> spanChecksum = buffer.Slice(FieldLocations.Checksum, FieldLengths.Checksum); 428private void ReadMagicAttribute(Span<byte> buffer) 430Span<byte> magic = buffer.Slice(FieldLocations.Magic, FieldLengths.Magic); 462private void ReadVersionAttribute(Span<byte> buffer) 469Span<byte> version = buffer.Slice(FieldLocations.Version, FieldLengths.Version); 516private void ReadPosixAndGnuSharedAttributes(Span<byte> buffer) 536private void ReadGnuAttributes(Span<byte> buffer) 550private void ReadUstarAttributes(Span<byte> buffer) 573Span<byte> span = _size <= 256 ? 643Span<byte> span = _size <= 256 ?
System\Formats\Tar\TarHeader.Write.cs (32)
29private void WriteWithSeekableDataStream(TarEntryFormat format, Stream archiveStream, Span<byte> buffer) 61private void WriteWithUnseekableDataStream(TarEntryFormat format, Stream destinationStream, Span<byte> buffer, bool shouldAdvanceToEnd) 159private void WriteV7FieldsToBuffer(Span<byte> buffer) 169private void WriteUstarFieldsToBuffer(Span<byte> buffer) 182internal void WriteAsPaxGlobalExtendedAttributes(Stream archiveStream, Span<byte> buffer, int globalExtendedAttributesEntryNumber) 207internal void WriteAsV7(Stream archiveStream, Span<byte> buffer) 234internal void WriteAsUstar(Stream archiveStream, Span<byte> buffer) 263internal void WriteAsPax(Stream archiveStream, Span<byte> buffer) 350internal void WriteAsGnu(Stream archiveStream, Span<byte> buffer) 437private void WriteGnuFieldsToBuffer(Span<byte> buffer) 449private void WriteAsPaxExtendedAttributes(Stream archiveStream, Span<byte> buffer, Dictionary<string, string> extendedAttributes, bool isGea, int globalExtendedAttributesEntryNumber) 480private void WritePaxFieldsToBuffer(Span<byte> buffer) 491private void WriteFieldsToBuffer(TarEntryFormat format, Span<byte> buffer) 512private int WriteName(Span<byte> buffer) 534private int WriteUstarName(Span<byte> buffer) 545Span<byte> encodingBuffer = stackalloc byte[MaxPathName]; 600private int WriteCommonFields(Span<byte> buffer, TarEntryType actualEntryType) 684private static int WritePosixMagicAndVersion(Span<byte> buffer) 692private static int WriteGnuMagicAndVersion(Span<byte> buffer) 700private int WritePosixAndGnuSharedFields(Span<byte> buffer) 754private int WriteGnuFields(Span<byte> buffer) 782Span<byte> zeros = stackalloc byte[TarHelpers.RecordSize]; 831Span<byte> span = stackalloc byte[512]; 945private static int WriteChecksum(int checksum, Span<byte> buffer) 951Span<byte> converted = stackalloc byte[FieldLengths.Checksum]; 955Span<byte> destination = buffer.Slice(FieldLocations.Checksum, FieldLengths.Checksum); 982private static int WriteLeftAlignedBytesAndGetChecksum(ReadOnlySpan<byte> bytesToWrite, Span<byte> destination) 996private static int WriteRightAlignedBytesAndGetChecksum(ReadOnlySpan<byte> bytesToWrite, Span<byte> destination) 1026private static int FormatOctal(long value, Span<byte> destination) 1029Span<byte> digits = stackalloc byte[32]; // longer than any possible octal formatting of a ulong 1044private static int WriteAsTimestamp(DateTimeOffset timestamp, Span<byte> destination) 1051private static int WriteAsUtf8String(ReadOnlySpan<char> text, Span<byte> buffer)
System\Formats\Tar\TarHelpers.cs (1)
134internal static bool IsAllNullBytes(Span<byte> buffer) =>
System\Formats\Tar\TarWriter.cs (2)
281Span<byte> buffer = stackalloc byte[TarHelpers.RecordSize]; 346Span<byte> emptyRecord = stackalloc byte[TarHelpers.RecordSize];
System.IO.Compression (13)
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (1)
101public override int Read(Span<byte> buffer)
System\IO\Compression\DeflateManaged\HuffmanTree.cs (2)
117Span<uint> bitLengthCount = stackalloc uint[17]; 125Span<uint> nextCode = stackalloc uint[17];
System\IO\Compression\DeflateManaged\InflaterManaged.cs (1)
98public int Inflate(Span<byte> bytes)
System\IO\Compression\DeflateManaged\InputBuffer.cs (1)
79Span<byte> span = _buffer.Span;
System\IO\Compression\DeflateManaged\OutputWindow.cs (1)
121public int CopyTo(Span<byte> output)
System\IO\Compression\DeflateZLib\DeflateStream.cs (2)
242public override int Read(Span<byte> buffer) 257internal int ReadCore(Span<byte> buffer)
System\IO\Compression\DeflateZLib\Inflater.cs (1)
75public unsafe int Inflate(Span<byte> destination)
System\IO\Compression\GZipStream.cs (1)
86public override int Read(Span<byte> buffer)
System\IO\Compression\ZipCustomStreams.cs (2)
101public override int Read(Span<byte> buffer) 306public override int Read(Span<byte> destination)
System\IO\Compression\ZLibStream.cs (1)
130public override int Read(Span<byte> buffer)
System.IO.Compression.Brotli (11)
System\IO\Compression\dec\BrotliDecoder.cs (2)
55public OperationStatus Decompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten) 114public static unsafe bool TryDecompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten)
System\IO\Compression\dec\BrotliStream.Decompress.cs (2)
57public override int Read(Span<byte> buffer) 184private bool TryDecompress(Span<byte> destination, out int bytesWritten)
System\IO\Compression\enc\BrotliEncoder.cs (5)
134public OperationStatus Flush(Span<byte> destination, out int bytesWritten) => Compress(ReadOnlySpan<byte>.Empty, destination, out _, out bytesWritten, BrotliEncoderOperation.Flush); 145public OperationStatus Compress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) => Compress(source, destination, out bytesConsumed, out bytesWritten, isFinalBlock ? BrotliEncoderOperation.Finish : BrotliEncoderOperation.Process); 147internal OperationStatus Compress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, BrotliEncoderOperation operation) 197public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) => TryCompress(source, destination, out bytesWritten, BrotliUtils.Quality_Default, BrotliUtils.WindowBits_Default); 206public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality, int window)
System\IO\Compression\enc\BrotliStream.Compress.cs (2)
69Span<byte> output = new Span<byte>(_buffer); 177Span<byte> output = new Span<byte>(_buffer);
System.IO.FileSystem.Watcher (8)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
System.IO.Hashing (28)
System\IO\Hashing\Crc32.cs (4)
65protected override void GetCurrentHashCore(Span<byte> destination) 75protected override void GetHashAndResetCore(Span<byte> destination) 129public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 151public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination)
System\IO\Hashing\Crc64.cs (4)
64protected override void GetCurrentHashCore(Span<byte> destination) 73protected override void GetHashAndResetCore(Span<byte> destination) 127public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 149public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination)
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (6)
74protected abstract void GetCurrentHashCore(Span<byte> destination); 201public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 226public int GetCurrentHash(Span<byte> destination) 263public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 288public int GetHashAndReset(Span<byte> destination) 322protected virtual void GetHashAndResetCore(Span<byte> destination)
System\IO\Hashing\XxHash128.cs (4)
83public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 99public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 165protected override void GetCurrentHashCore(Span<byte> destination) 212private static void WriteBigEndian128(in Hash128 hash, Span<byte> destination)
System\IO\Hashing\XxHash3.cs (3)
83public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0) 99public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 163protected override void GetCurrentHashCore(Span<byte> destination)
System\IO\Hashing\XxHash32.cs (3)
115protected override void GetCurrentHashCore(Span<byte> destination) 201public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int seed = 0) 224public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, int seed = 0)
System\IO\Hashing\XxHash64.cs (3)
115protected override void GetCurrentHashCore(Span<byte> destination) 201public static bool TryHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, long seed = 0) 224public static int Hash(ReadOnlySpan<byte> source, Span<byte> destination, long seed = 0)
System\IO\Hashing\XxHashShared.cs (1)
322Span<byte> remaining = new Span<byte>(buffer, source.Length - sourceIndex);
System.IO.IsolatedStorage (1)
System\IO\IsolatedStorage\IsolatedStorageFileStream.cs (1)
251public override int Read(System.Span<byte> buffer)
System.IO.MemoryMappedFiles (1)
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (1)
261Span<char> guid = stackalloc char[32];
System.IO.Pipelines (14)
System\IO\Pipelines\Pipe.cs (2)
143internal Span<byte> GetSpan(int sizeHint) 1103Span<byte> destination = _writingHeadMemory.Span;
System\IO\Pipelines\Pipe.DefaultPipeWriter.cs (1)
38public override Span<byte> GetSpan(int sizeHint = 0) => _pipe.GetSpan(sizeHint);
System\IO\Pipelines\PipeReaderStream.cs (4)
60Span<byte> oneByte = stackalloc byte[1]; 64private int ReadInternal(Span<byte> buffer) 94public override int Read(Span<byte> buffer) 111private int HandleReadResult(ReadResult result, Span<byte> buffer)
System\IO\Pipelines\PipeWriter.cs (6)
61/// <summary>Notifies the <see cref="System.IO.Pipelines.PipeWriter" /> that <paramref name="bytes" /> bytes were written to the output <see cref="System.Span{T}" /> or <see cref="System.Memory{T}" />. You must request a new buffer after calling <see cref="System.IO.Pipelines.PipeWriter.Advance(int)" /> to continue writing more data; you cannot write to a previously acquired buffer.</summary> 62/// <param name="bytes">The number of bytes written to the <see cref="System.Span{T}" /> or <see cref="System.Memory{T}" />.</param> 74/// <summary>Returns a <see cref="System.Span{T}" /> to write to that is at least the requested size, as specified by the <paramref name="sizeHint" /> parameter.</summary> 75/// <param name="sizeHint">The minimum length of the returned <see cref="System.Span{T}" />. If 0, a non-empty buffer of arbitrary size is returned.</param> 78/// This method never returns <see cref="System.Span{T}.Empty" />, but it throws an <see cref="System.OutOfMemoryException" /> if the requested buffer size is not available. 81public abstract Span<byte> GetSpan(int sizeHint = 0);
System\IO\Pipelines\StreamPipeWriter.cs (1)
102public override Span<byte> GetSpan(int sizeHint = 0)
System.IO.Pipes (2)
System\IO\Pipes\PipeStream.Unix.cs (2)
47public override int Read(Span<byte> buffer) 256private unsafe int ReadCore(Span<byte> buffer)
System.Linq (22)
System\Linq\Enumerable.cs (1)
32internal static Span<T> SetCountAndGetSpan<T>(List<T> list, int count)
System\Linq\Lookup.cs (1)
160Span<TResult> span = Enumerable.SetCountAndGetSpan(list, _count);
System\Linq\OrderedEnumerable.cs (1)
236private static void Sort(Span<TElement> span, bool descending)
System\Linq\OrderedEnumerable.SpeedOpt.cs (2)
45private void Fill(TElement[] buffer, Span<TElement> destination) 112private void Fill(int minIdx, int maxIdx, TElement[] buffer, Span<TElement> destination)
System\Linq\Range.cs (1)
79private static void FillIncrementing(Span<int> destination, int value)
System\Linq\SegmentedArrayBuilder.cs (7)
31private Span<T> _firstSegment; 33private Span<T> _currentSegment; 44public SegmentedArrayBuilder(Span<T> scratchBuffer) 104Span<T> currentSegment = _currentSegment; 213Span<T> currentSegment = _currentSegment; 277public readonly void ToSpan(Span<T> destination) => ToSpanInlined(destination); 282private readonly void ToSpanInlined(Span<T> destination)
System\Linq\Select.SpeedOpt.cs (6)
158private static void Fill(ReadOnlySpan<TSource> source, Span<TResult> destination, Func<TSource, TResult> func) 284private static void Fill(Span<TResult> results, int start, Func<int, TResult> func) 384private static void Fill(ReadOnlySpan<TSource> source, Span<TResult> destination, Func<TSource, TResult> func) 487private static void Fill(IList<TSource> source, Span<TResult> results, Func<TSource, TResult> func) 725private static void Fill(Iterator<TSource> source, Span<TResult> results, Func<TSource, TResult> func) 900private static void Fill(IList<TSource> source, Span<TResult> destination, Func<TSource, TResult> func, int sourceIndex)
System\Linq\SingleLinkedNode.cs (2)
103public void Fill(Span<TSource> span) 117public void FillReversed(Span<TSource> span)
System\Linq\SkipTake.SpeedOpt.cs (1)
149private static void Fill(IList<TSource> source, Span<TSource> destination, int sourceIndex)
System.Linq.Expressions (1)
System\Linq\Expressions\Compiler\ILGen.cs (1)
978Span<int> bits = stackalloc int[4];
System.Memory (27)
artifacts\obj\System.Memory\Debug\net9.0\System.Memory.Forwards.cs (1)
18[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
src\libraries\Common\src\System\Buffers\ArrayBufferWriter.cs (6)
115/// Notifies <see cref="IBufferWriter{T}"/> that <paramref name="count"/> amount of data was written to the output <see cref="Span{T}"/>/<see cref="Memory{T}"/> 169/// Returns a <see cref="Span{T}"/> to write to that is at least the requested length (specified by <paramref name="sizeHint"/>). 177/// This will never return an empty <see cref="Span{T}"/>. 186/// If you reset the writer using the <see cref="ResetWrittenCount"/> method, this method may return a non-cleared <see cref="Span{T}"/>. 189/// If you clear the writer using the <see cref="Clear"/> method, this method will return a <see cref="Span{T}"/> with its content zeroed. 192public Span<T> GetSpan(int sizeHint = 0)
System\Buffers\BuffersExtensions.cs (6)
58/// Copy the <see cref="ReadOnlySequence{T}"/> to the specified <see cref="Span{Byte}"/>. 61/// <param name="destination">The destination <see cref="Span{Byte}"/>.</param> 63public static void CopyTo<T>(in this ReadOnlySequence<T> source, Span<T> destination) 78private static void CopyToMultiSegment<T>(in ReadOnlySequence<T> sequence, Span<T> destination) 118Span<T> destination = writer.GetSpan(); 132private static void WriteMultiSegment<T>(IBufferWriter<T> writer, in ReadOnlySpan<T> source, Span<T> destination)
System\Buffers\IBufferWriter.cs (4)
12/// Notifies <see cref="IBufferWriter{T}"/> that <paramref name="count"/> amount of data was written to the output <see cref="Span{T}"/>/<see cref="Memory{T}"/> 36/// Returns a <see cref="Span{T}"/> to write to that is at least the requested length (specified by <paramref name="sizeHint"/>). 40/// This must never return an empty <see cref="Span{T}"/> but it can throw 49Span<T> GetSpan(int sizeHint = 0);
System\Buffers\SequenceReader.cs (2)
410public readonly bool TryCopyTo(Span<T> destination) 427internal readonly bool TryCopyMultisegment(Span<T> destination)
System\Buffers\SequenceReaderExtensions.Binary.cs (1)
43Span<byte> tempSpan = new Span<byte>(&buffer, sizeof(T));
System\Text\EncodingExtensions.cs (7)
44Span<byte> scratchBuffer = writer.GetSpan(byteCount); 100public static int GetBytes(this Encoding encoding, in ReadOnlySequence<char> chars, Span<byte> bytes) 200Span<byte> remainingBytes = retVal; 235Span<char> scratchBuffer = writer.GetSpan(charCount); 291public static int GetChars(this Encoding encoding, in ReadOnlySequence<byte> bytes, Span<char> chars) 436Span<byte> scratchBuffer = writer.GetSpan(byteCountForThisSlice); 529Span<char> scratchBuffer = writer.GetSpan(charCountForThisSlice);
System.Memory.Data (2)
src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (2)
99public override int Read(Span<byte> buffer) => ReadBuffer(buffer); 102private int ReadBuffer(Span<byte> buffer)
System.Net.Http (110)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
95public override int Read(Span<byte> buffer)
src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (2)
99public override int Read(Span<byte> buffer) => ReadBuffer(buffer); 102private int ReadBuffer(Span<byte> buffer)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (2)
83public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 88public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (22)
25public static bool EncodeIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 45public static bool EncodeStatusHeader(int statusCode, Span<byte> destination, out int bytesWritten) 77public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 109public static bool EncodeLiteralHeaderFieldNeverIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 141public static bool EncodeLiteralHeaderFieldIndexing(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 176public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span<byte> destination, out int bytesWritten) 208public static bool EncodeLiteralHeaderFieldIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 229public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 250public static bool EncodeLiteralHeaderFieldNeverIndexingNewName(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 270private static bool EncodeLiteralHeaderNewNameCore(byte mask, string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 288public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 324public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span<byte> destination, out int bytesWritten) 358private static bool EncodeLiteralHeaderName(string value, Span<byte> destination, out int bytesWritten) 395private static void EncodeValueStringPart(string value, Span<byte> destination) 410public static bool EncodeStringLiteral(ReadOnlySpan<byte> value, Span<byte> destination, out int bytesWritten) 444public static bool EncodeStringLiteral(string value, Span<byte> destination, out int bytesWritten) 449public static bool EncodeStringLiteral(string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 494public static bool EncodeDynamicTableSizeUpdate(int value, Span<byte> destination, out int bytesWritten) 513public static bool EncodeStringLiterals(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 601Span<byte> span = stackalloc byte[256]; 613Span<byte> span = stackalloc byte[256]; 622Span<byte> span =
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs (1)
679Span<byte> dst = dstArray;
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs (1)
23public static bool Encode(int value, int numBits, Span<byte> destination, out int bytesWritten)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs (1)
41public static bool TryWriteFrameEnvelope(Http3FrameType frameType, long payloadLength, Span<byte> buffer, out int bytesWritten)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (3)
114Span<byte> temp = (stackalloc byte[8])[..length]; 147public static bool TryWrite(Span<byte> buffer, long longToEncode, out int bytesWritten) 190public static int WriteInteger(Span<byte> buffer, long longToEncode)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (18)
23public static bool EncodeStaticIndexedHeaderField(int index, Span<byte> destination, out int bytesWritten) 39Span<byte> buffer = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; 61public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Span<byte> destination, out int bytesWritten) 66public static bool EncodeLiteralHeaderFieldWithStaticNameReference(int index, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 89/// Encodes just the name part of a Literal Header Field With Static Name Reference. Must call <see cref="EncodeValueString(string, Encoding?, Span{byte}, out int)"/> after to encode the header's value. 93Span<byte> temp = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength]; 104Span<byte> temp = value.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; 125public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Span<byte> destination, out int bytesWritten) 130public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, string value, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 147public static bool EncodeLiteralHeaderFieldWithoutNameReference(string name, ReadOnlySpan<string> values, byte[] separator, Encoding? valueEncoding, Span<byte> destination, out int bytesWritten) 160/// Encodes just the value part of a Literawl Header Field Without Static Name Reference. Must call <see cref="EncodeValueString(string, Encoding?, Span{byte}, out int)"/> after to encode the header's value. 164Span<byte> temp = name.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength] : new byte[name.Length + IntegerEncoder.MaxInt32EncodedLength]; 174Span<byte> temp = (name.Length + value.Length) < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[name.Length + value.Length + IntegerEncoder.MaxInt32EncodedLength * 2]; 182private static bool EncodeValueString(string s, Encoding? valueEncoding, Span<byte> buffer, out int length) 220public static bool EncodeValueString(ReadOnlySpan<string> values, byte[]? separator, Encoding? valueEncoding, Span<byte> buffer, out int length) 301private static void EncodeValueStringPart(string s, Span<byte> buffer) 316private static bool EncodeNameString(string s, Span<byte> buffer, out int length) 355private static bool EncodeHeaderBlockPrefix(Span<byte> destination, out int bytesWritten)
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
385public void CopyTo(Span<byte> destination)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
System\Net\Http\EmptyReadStream.cs (1)
22public override int Read(Span<byte> buffer) => 0;
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (1)
471Span<Range> parts = stackalloc Range[6];
System\Net\Http\Headers\HttpHeaders.cs (1)
1181private static void ReadStoreValues<T>(Span<string?> values, object? storeValue, HttpHeaderParser? parser, ref int currentIndex)
System\Net\Http\Headers\RangeItemHeaderValue.cs (1)
54Span<char> stackBuffer = stackalloc char[128];
System\Net\Http\Headers\UriHeaderParser.cs (1)
69Span<byte> rawBytes = input.Length <= 256 ? stackalloc byte[input.Length] : new byte[input.Length];
System\Net\Http\HttpBaseStream.cs (1)
87public abstract override int Read(Span<byte> buffer);
System\Net\Http\MultipartContent.cs (2)
490public override int Read(Span<byte> buffer) 649Span<byte> buffer = maxLength <= StackallocThreshold
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (1)
215Span<byte> hashBuffer = stackalloc byte[SHA256.HashSizeInBytes]; // SHA256 is the largest hash produced
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (2)
29public override int Read(Span<byte> buffer) 294private int ReadChunksFromConnectionBuffer(Span<byte> buffer, CancellationTokenRegistration cancellationRegistration)
System\Net\Http\SocketsHttpHandler\ConnectionCloseReadStream.cs (1)
18public override int Read(Span<byte> buffer)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (1)
423Span<HttpConnection> usable = stackCopy.AsSpan(0, usableConnections);
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (1)
23public override int Read(Span<byte> buffer)
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (2)
261public override int Read(Span<byte> buffer) 365public override int Read(Span<byte> buffer)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (5)
1293Span<byte> span = writeBuffer.Span; 1305Span<byte> span = writeBuffer.Span; 1647Span<byte> span = writeBuffer.Span; 1758Span<byte> span = writeBuffer.Span; 1936public static void WriteTo(Span<byte> destination, int payloadLength, FrameType type, FrameFlags flags, int streamId)
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (4)
1106private (bool wait, int bytesRead) TryReadFromBuffer(Span<byte> buffer, bool partOfSyncRead = false) 1137public int ReadData(Span<byte> buffer, HttpResponseMessage responseMessage) 1523public override int Read(Span<byte> buffer) => throw new NotSupportedException(SR.net_http_content_writeonly_stream); 1597public override int Read(Span<byte> destination)
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (1)
411Span<byte> buffer = stackalloc byte[4 + VariableLengthIntegerHelper.MaximumEncodedLength];
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (3)
1090private int ReadResponseContent(HttpResponseMessage response, Span<byte> buffer) 1397public override int Read(Span<byte> buffer) 1447public override int Read(Span<byte> buffer)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (12)
372Span<byte> buffer = _writeBuffer.AvailableSpan; 440Span<byte> buffer = _writeBuffer.AvailableSpan; 471Span<byte> buffer = _writeBuffer.AvailableSpan; 991Span<byte> buffer = _readBuffer.ActiveSpan; 1018private static void ParseStatusLineCore(Span<byte> line, HttpResponseMessage response) 1093Span<byte> buffer = _readBuffer.ActiveSpan; 1110private (bool finished, int bytesConsumed) ParseHeadersCore(Span<byte> buffer, HttpResponseMessage? response, bool isFromTrailer) 1140Span<byte> valueIterator = buffer.Slice(valueStartIdx); 1492Span<byte> temp = stackalloc byte[8]; // max length of Int32 as hex 1706private int ReadFromBuffer(Span<byte> buffer) 1717private int Read(Span<byte> destination) 1761private int ReadBuffered(Span<byte> destination)
System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs (1)
34public sealed override int Read(Span<byte> buffer) => throw new NotSupportedException();
System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs (1)
236Span<Range> tokens = stackalloc Range[3];
System\Net\Http\SocketsHttpHandler\RawConnectionStream.cs (1)
24public override int Read(Span<byte> buffer)
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (1)
320private static byte EncodeString(ReadOnlySpan<char> chars, Span<byte> buffer, string parameterName)
System.Net.HttpListener (6)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
79Span<Range> parts = stackalloc Range[3];
System.Net.Mail (15)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
System\Net\Mail\SmtpNegotiateAuthenticationModule.cs (1)
122Span<byte> unwrappedChallenge;
System\Net\Mime\MimeBasePart.cs (1)
99Span<Range> subStrings = stackalloc Range[6];
System.Net.NameResolution (9)
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (9)
73public static unsafe void SetAddressFamily(Span<byte> buffer, AddressFamily family) 101public static unsafe void SetPort(Span<byte> buffer, ushort port) 125public static unsafe void GetIPv6Address(ReadOnlySpan<byte> buffer, Span<byte> address, out uint scope) 139public static unsafe void SetIPv4Address(Span<byte> buffer, uint address) 150public static unsafe void SetIPv4Address(Span<byte> buffer, byte* address) 156public static unsafe void SetIPv6Address(Span<byte> buffer, Span<byte> address, uint scope) 165public static unsafe void SetIPv6Address(Span<byte> buffer, byte* address, int addressLength, uint scope) 176public static unsafe void Clear(Span<byte> buffer)
System.Net.NetworkInformation (8)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (1)
361Span<byte> addressBytes = stackalloc byte[16];
System\Net\NetworkInformation\StringParsingHelpers.Statistics.cs (1)
410Span<Range> pieces = stackalloc Range[18]; // [0]-[16] used, +1 to ensure any additional segment goes into [17]
System\Net\NetworkInformation\UnicastIPAddressInformation.cs (1)
75Span<byte> addressBytes = (family == AddressFamily.InterNetwork) ?
System.Net.Ping (19)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (6)
17Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 32public static void SetIPAddress(Span<byte> socketAddressBuffer, IPAddress address) 44Span<byte> addressBuffer = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 78Span<byte> addressBuffer1 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 79Span<byte> addressBuffer2 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes];
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (9)
73public static unsafe void SetAddressFamily(Span<byte> buffer, AddressFamily family) 101public static unsafe void SetPort(Span<byte> buffer, ushort port) 125public static unsafe void GetIPv6Address(ReadOnlySpan<byte> buffer, Span<byte> address, out uint scope) 139public static unsafe void SetIPv4Address(Span<byte> buffer, uint address) 150public static unsafe void SetIPv4Address(Span<byte> buffer, byte* address) 156public static unsafe void SetIPv6Address(Span<byte> buffer, Span<byte> address, uint scope) 165public static unsafe void SetIPv6Address(Span<byte> buffer, byte* address, int addressLength, uint scope) 176public static unsafe void Clear(Span<byte> buffer)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (3)
16private Span<byte> _bytes; 18public ValueUtf8Converter(Span<byte> initialBuffer) 24public Span<byte> ConvertAndTerminateString(ReadOnlySpan<char> value)
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
246Span<byte> socketAddress = stackalloc byte[SocketAddress.GetMaximumAddressSize(address.AddressFamily)];
System.Net.Primitives (48)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (6)
17Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 32public static void SetIPAddress(Span<byte> socketAddressBuffer, IPAddress address) 44Span<byte> addressBuffer = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 78Span<byte> addressBuffer1 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 79Span<byte> addressBuffer2 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes];
src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (1)
21Span<byte> numbers = stackalloc byte[NumberOfLabels];
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
287internal static void Parse(ReadOnlySpan<char> address, Span<ushort> numbers, int start, ref string? scopeId)
src\libraries\Common\src\System\Net\SocketAddress.cs (2)
105Span<byte> addressBytes = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 168Span<char> result = maxLength <= 256 ? // arbitrary limit that should be large enough for the vast majority of cases
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (9)
73public static unsafe void SetAddressFamily(Span<byte> buffer, AddressFamily family) 101public static unsafe void SetPort(Span<byte> buffer, ushort port) 125public static unsafe void GetIPv6Address(ReadOnlySpan<byte> buffer, Span<byte> address, out uint scope) 139public static unsafe void SetIPv4Address(Span<byte> buffer, uint address) 150public static unsafe void SetIPv4Address(Span<byte> buffer, byte* address) 156public static unsafe void SetIPv6Address(Span<byte> buffer, Span<byte> address, uint scope) 165public static unsafe void SetIPv6Address(Span<byte> buffer, byte* address, int addressLength, uint scope) 176public static unsafe void Clear(Span<byte> buffer)
System\Net\CookieContainer.cs (1)
611Span<Range> ipParts = stackalloc Range[5];
System\Net\IPAddress.cs (10)
273public bool TryWriteBytes(Span<byte> destination, out int bytesWritten) 302private void WriteIPv6Bytes(Span<byte> destination) 330private void WriteIPv4Bytes(Span<byte> destination) 411Span<char> span = stackalloc char[IPAddressParser.MaxIPv6StringLength]; 426public bool TryFormat(Span<char> destination, out int charsWritten) => 433public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten) => 437bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 442bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 446private bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IBinaryInteger<TChar> 465Span<TChar> tmpDestination = stackalloc TChar[IPAddressParser.MaxIPv6StringLength];
System\Net\IPAddressParser.cs (9)
25Span<ushort> numbers = stackalloc ushort[IPAddressParserStatics.IPv6AddressShorts]; 68private static unsafe bool TryParseIPv6(ReadOnlySpan<char> ipSpan, Span<ushort> numbers, int numbersLength, out uint scope) 110internal static int FormatIPv4Address<TChar>(uint address, Span<TChar> addressString) where TChar : unmanaged, IBinaryInteger<TChar> 125static int FormatByte(uint number, Span<TChar> addressString) 154internal static int FormatIPv6Address<TChar>(ushort[] address, uint scopeId, Span<TChar> destination) where TChar : unmanaged, IBinaryInteger<TChar> 183Span<TChar> chars = stackalloc TChar[10]; 191Span<TChar> used = chars.Slice(bytesPos); 201static void AppendSections(ReadOnlySpan<ushort> address, Span<TChar> destination, ref int offset) 240static void AppendHex(ushort value, Span<TChar> destination, ref int offset)
System\Net\IPNetwork.cs (4)
251public bool TryFormat(Span<char> destination, out int charsWritten) => 260public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten) => 309bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 314bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) =>
System.Net.Quic (52)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs (3)
25internal static unsafe int BioGets(SafeBioHandle b, Span<byte> buf) 37private static partial int BioRead(SafeBioHandle b, Span<byte> data, int len); 38internal static int BioRead(SafeBioHandle b, Span<byte> data) => BioRead(b, data, data.Length);
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (2)
83public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 88public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (6)
17Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 32public static void SetIPAddress(Span<byte> socketAddressBuffer, IPAddress address) 44Span<byte> addressBuffer = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 78Span<byte> addressBuffer1 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 79Span<byte> addressBuffer2 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes];
src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (1)
21Span<byte> numbers = stackalloc byte[NumberOfLabels];
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
287internal static void Parse(ReadOnlySpan<char> address, Span<ushort> numbers, int start, ref string? scopeId)
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
385public void CopyTo(Span<byte> destination)
src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
16internal static SslPolicyErrors BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, bool checkCertName, bool isServer, string? hostName, Span<byte> certificateBuffer)
src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
87Span<byte> clientRandomUtf8 = clientRandom.Length <= 1024 ? stackalloc byte[clientRandom.Length * 2] : new byte[clientRandom.Length * 2]; 112Span<byte> line = totalLength <= 1024 ? stackalloc byte[totalLength] : new byte[totalLength]; 126private static void HexEncode(ReadOnlySpan<byte> source, Span<byte> destination)
src\libraries\Common\src\System\Net\Security\TargetHostNameHelper.cs (1)
58Span<ushort> numbers = stackalloc ushort[IPAddressParserStatics.IPv6AddressShorts];
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (9)
73public static unsafe void SetAddressFamily(Span<byte> buffer, AddressFamily family) 101public static unsafe void SetPort(Span<byte> buffer, ushort port) 125public static unsafe void GetIPv6Address(ReadOnlySpan<byte> buffer, Span<byte> address, out uint scope) 139public static unsafe void SetIPv4Address(Span<byte> buffer, uint address) 150public static unsafe void SetIPv4Address(Span<byte> buffer, byte* address) 156public static unsafe void SetIPv6Address(Span<byte> buffer, Span<byte> address, uint scope) 165public static unsafe void SetIPv6Address(Span<byte> buffer, byte* address, int addressLength, uint scope) 176public static unsafe void Clear(Span<byte> buffer)
src\libraries\Common\src\System\Net\StreamBuffer.cs (2)
193private (bool wait, int bytesRead) TryReadFromBuffer(Span<byte> buffer) 224public int Read(Span<byte> buffer)
System\Net\Quic\Internal\MsQuicHelpers.cs (2)
41Span<byte> addressBytes = new Span<byte>(quicAddress, SocketAddressPal.IPv6AddressSize); 52Span<byte> rawAddress = MemoryMarshal.AsBytes(MemoryMarshal.CreateSpan(ref result, 1));
System\Net\Quic\Internal\MsQuicTlsSecret.cs (10)
58Span<byte> clientHandshakeTrafficSecret = _tlsSecrets->IsSet.ClientHandshakeTrafficSecret != 0 60: Span<byte>.Empty; 62Span<byte> serverHandshakeTrafficSecret = _tlsSecrets->IsSet.ServerHandshakeTrafficSecret != 0 64: Span<byte>.Empty; 66Span<byte> clientTrafficSecret0 = _tlsSecrets->IsSet.ClientTrafficSecret0 != 0 68: Span<byte>.Empty; 70Span<byte> serverTrafficSecret0 = _tlsSecrets->IsSet.ServerTrafficSecret0 != 0 72: Span<byte>.Empty; 74Span<byte> clientEarlyTrafficSecret = _tlsSecrets->IsSet.ClientEarlyTrafficSecret != 0 76: Span<byte>.Empty;
System\Net\Quic\Internal\ReceiveBuffers.cs (1)
55Span<byte> quicBuffer = quicBuffers[i].Span;
System\Net\Quic\Interop\msquic.cs (1)
23public readonly Span<byte> Span => new(Buffer, (int)Length);
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (2)
176private QUIC_TLS_ALERT_CODES ValidateCertificate(X509Certificate2? certificate, Span<byte> certData, Span<byte> chainData)
System\Net\Quic\QuicStream.Stream.cs (1)
114public override int Read(Span<byte> buffer)
System.Net.Requests (3)
System\Net\FtpControlStream.cs (1)
891Span<Range> parts = stackalloc Range[4];
System\Net\FtpDataStream.cs (1)
196public override int Read(Span<byte> buffer)
System\Net\HttpWebResponse.cs (1)
400public override int Read(Span<byte> buffer)
System.Net.Security (83)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs (3)
25internal static unsafe int BioGets(SafeBioHandle b, Span<byte> buf) 37private static partial int BioRead(SafeBioHandle b, Span<byte> data, int len); 38internal static int BioRead(SafeBioHandle b, Span<byte> data) => BioRead(b, data, data.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (6)
170Span<byte> contextId = stackalloc byte[32]; 401Span<IntPtr> handles = certList.Count <= 256 ? 567internal static int Decrypt(SafeSslHandle context, Span<byte> buffer, out Ssl.SslErrorCode errorCode) 668var clientList = new Span<byte>(inp, (int)inlen); 672Span<byte> clientProto = clientList.Slice(1, length); 761private static int BioRead(SafeBioHandle bio, Span<byte> buffer, int count)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (4)
207internal static void SerializeAlpnProtocolList(List<SslApplicationProtocol> applicationProtocols, Span<byte> buffer) 224Span<byte> buffer = length <= 256 ? stackalloc byte[256].Slice(0, length) : new byte[length]; 229internal static unsafe int SslSetAlpnProtos(SafeSslHandle ssl, Span<byte> serializedProtocols) 245internal static unsafe bool SslAddClientCAs(SafeSslHandle ssl, Span<IntPtr> x509handles)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (1)
40internal static unsafe partial int SslCtxSetCaching(SafeSslContextHandle ctx, int mode, int cacheSize, int contextIdLength, Span<byte> contextId, delegate* unmanaged<IntPtr, IntPtr, int> neewSessionCallback, delegate* unmanaged<IntPtr, IntPtr, void> removeSessionCallback);
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (2)
83public Span<byte> ActiveSpan => new Span<byte>(_bytes, _activeStart, _availableStart - _activeStart); 88public Span<byte> AvailableSpan => _bytes.AsSpan(_availableStart);
src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (1)
21Span<byte> numbers = stackalloc byte[NumberOfLabels];
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
287internal static void Parse(ReadOnlySpan<char> address, Span<ushort> numbers, int start, ref string? scopeId)
src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
16internal static SslPolicyErrors BuildChainAndVerifyProperties(X509Chain chain, X509Certificate2 remoteCertificate, bool checkCertName, bool isServer, string? hostName, Span<byte> certificateBuffer)
src\libraries\Common\src\System\Net\Security\MD4.cs (14)
63internal static void HashData(ReadOnlySpan<byte> source, Span<byte> destination) 67Span<byte> buffer = stackalloc byte[64]; 70Span<uint> state = stackalloc uint[4] { 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 }; 71Span<uint> count = stackalloc uint[2] { 0, 0 }; 76Span<byte> bits = stackalloc byte[8]; 82Span<byte> padding = stackalloc byte[padLen]; 94private static void HashCore(ReadOnlySpan<byte> input, Span<uint> state, Span<uint> count, Span<byte> buffer) 171private static void Encode(Span<byte> output, Span<uint> input) 179private static void Decode(Span<uint> output, ReadOnlySpan<byte> input) 187private static void MD4Transform(Span<uint> state, ReadOnlySpan<byte> block) 193Span<uint> x = stackalloc uint[16];
src\libraries\Common\src\System\Net\Security\RC4.cs (1)
76public void Transform(ReadOnlySpan<byte> input, Span<byte> output)
src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
87Span<byte> clientRandomUtf8 = clientRandom.Length <= 1024 ? stackalloc byte[clientRandom.Length * 2] : new byte[clientRandom.Length * 2]; 112Span<byte> line = totalLength <= 1024 ? stackalloc byte[totalLength] : new byte[totalLength]; 126private static void HexEncode(ReadOnlySpan<byte> source, Span<byte> destination)
src\libraries\Common\src\System\Net\Security\TargetHostNameHelper.cs (1)
58Span<ushort> numbers = stackalloc ushort[IPAddressParserStatics.IPv6AddressShorts];
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (1)
33Span<char> dest = urlEncoded;
System\Net\NegotiateAuthenticationPal.cs (1)
25public abstract NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (26)
295private static unsafe void CreateNtlmNegotiateMessage(Span<byte> asBytes, Flags requiredFlags) 341Span<byte> span = MemoryMarshal.AsBytes(new Span<MessageField>(ref field)); 347private static void AddToPayload(ref MessageField field, ReadOnlySpan<byte> data, Span<byte> payload, ref int offset) 354private static void AddToPayload(ref MessageField field, ReadOnlySpan<char> data, Span<byte> payload, ref int offset) 365private static void makeNtlm2Hash(string domain, string userName, ReadOnlySpan<char> password, Span<byte> hash) 374Span<byte> pwHash = stackalloc byte[DigestLength]; 375Span<byte> pwBytes = stackalloc byte[Encoding.Unicode.GetByteCount(password)]; 398private unsafe void makeNtlm2ChallengeResponse(DateTime time, ReadOnlySpan<byte> ntlm2hash, ReadOnlySpan<byte> serverChallenge, Span<byte> clientChallenge, ReadOnlySpan<byte> serverInfo, ref MessageField field, Span<byte> payload, ref int payloadOffset) 404Span<byte> blob = payload.Slice(payloadOffset, sizeof(NtChallengeResponse) + serverInfo.Length); 429private unsafe void WriteChannelBindingHash(Span<byte> hashBuffer) 440Span<byte> prefix = stackalloc byte[sizeof(uint) * 5]; 620Span<byte> responseAsSpan = new Span<byte>(responseBytes); 624Span<byte> payload = responseAsSpan; 635Span<byte> ntlm2hash = stackalloc byte[DigestLength]; 639Span<byte> clientChallenge = stackalloc byte[ChallengeLength]; 657Span<byte> exportedSessionKey = stackalloc byte[16]; 664Span<byte> sessionBaseKey = stackalloc byte[HMACMD5.HashSizeInBytes]; 671Span<byte> encryptedRandomSessionKey = payload.Slice(payloadOffset, 16); 718Span<byte> signature) 726Span<byte> hmacResult = stackalloc byte[hmac.HashLengthInBytes]; 743Span<byte> expectedSignature = stackalloc byte[SignatureLength]; 756Span<byte> signatureBuffer = signature.GetSpan(SignatureLength); 769Span<byte> output = outputWriter.GetSpan(input.Length + SignatureLength); 794Span<byte> output = outputWriter.GetSpan(input.Length - SignatureLength); 807public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (1)
424public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\NegotiateAuthenticationPal.Unix.cs (1)
389public override unsafe NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\NegotiateAuthenticationPal.Unsupported.cs (1)
54public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) => throw new InvalidOperationException();
System\Net\Security\NegotiateAuthentication.cs (1)
345public NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\Security\SslStream.cs (4)
84public Span<byte> DecryptedSpan => _buffer.ActiveSpan.Slice(0, _decryptedLength); 96public Span<byte> EncryptedSpanSliced(int length) => _buffer.ActiveSpan.Slice(_decryptedLength + _decryptedPadding, length); 771public override unsafe int Read(Span<byte> buffer) 974public override Span<byte> GetSpan()
System\Net\Security\SslStream.Protocol.cs (3)
1016internal SecurityStatusPal Decrypt(Span<byte> buffer, out int outputOffset, out int outputCount) 1393internal Span<byte> AvailableSpan => Payload == null ? Span<byte>.Empty : new Span<byte>(Payload, Size, Available);
System\Net\Security\SslStreamPal.Unix.cs (1)
78public static SecurityStatusPal DecryptMessage(SafeDeleteSslContext securityContext, Span<byte> buffer, out int offset, out int count)
System.Net.Sockets (64)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (6)
17Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 32public static void SetIPAddress(Span<byte> socketAddressBuffer, IPAddress address) 44Span<byte> addressBuffer = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 57public static void Serialize(this IPEndPoint endPoint, Span<byte> destination) 78Span<byte> addressBuffer1 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 79Span<byte> addressBuffer2 = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes];
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (9)
73public static unsafe void SetAddressFamily(Span<byte> buffer, AddressFamily family) 101public static unsafe void SetPort(Span<byte> buffer, ushort port) 125public static unsafe void GetIPv6Address(ReadOnlySpan<byte> buffer, Span<byte> address, out uint scope) 139public static unsafe void SetIPv4Address(Span<byte> buffer, uint address) 150public static unsafe void SetIPv4Address(Span<byte> buffer, byte* address) 156public static unsafe void SetIPv6Address(Span<byte> buffer, Span<byte> address, uint scope) 165public static unsafe void SetIPv6Address(Span<byte> buffer, byte* address, int addressLength, uint scope) 176public static unsafe void Clear(Span<byte> buffer)
System\Net\Sockets\NetworkStream.cs (1)
238public override int Read(Span<byte> buffer)
System\Net\Sockets\Socket.cs (15)
141Span<byte> buffer = stackalloc byte[SocketPal.MaximumAddressSize]; 164Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 196Span<byte> address = stackalloc byte[IPAddressParserStatics.IPv6AddressBytes]; 301Span<byte> buffer = stackalloc byte[SocketAddress.GetMaximumAddressSize(_addressFamily)]; 349Span<byte> buffer = stackalloc byte[SocketAddress.GetMaximumAddressSize(_addressFamily)]; 1474public int Receive(Span<byte> buffer) => Receive(buffer, SocketFlags.None); 1476public int Receive(Span<byte> buffer, SocketFlags socketFlags) 1484public int Receive(Span<byte> buffer, SocketFlags socketFlags, out SocketError errorCode) 1617/// An <see cref="Span{T}"/> of type <see cref="byte"/> that is the storage location for received data. 1634/// <see cref="Socket.ReceiveMessageFrom(Span{byte}, ref SocketFlags, ref EndPoint, out IPPacketInformation)"/> 1639public int ReceiveMessageFrom(Span<byte> buffer, ref SocketFlags socketFlags, ref EndPoint remoteEP, out IPPacketInformation ipPacketInformation) 1802public int ReceiveFrom(Span<byte> buffer, ref EndPoint remoteEP) 1817public int ReceiveFrom(Span<byte> buffer, SocketFlags socketFlags, ref EndPoint remoteEP) 1898public int ReceiveFrom(Span<byte> buffer, SocketFlags socketFlags, SocketAddress receivedAddress) 2171public int GetRawSocketOption(int optionLevel, int optionName, Span<byte> optionValue)
System\Net\Sockets\SocketAsyncContext.Unix.cs (4)
513bool completed = SocketPal.TryCompleteReceiveFrom(context._socket, default(Span<byte>), Buffers, Flags, SocketAddress.Span, out int socketAddressLen, out BytesTransferred, out ReceivedFlags, out ErrorCode); 1544public SocketError Receive(Span<byte> buffer, SocketFlags flags, int timeout, out int bytesReceived) 1585public unsafe SocketError ReceiveFrom(Span<byte> buffer, ref SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, int timeout, out int bytesReceived) 1797Span<byte> buffer, ref SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, int timeout, out IPPacketInformation ipPacketInformation, out int bytesReceived)
System\Net\Sockets\SocketPal.Unix.cs (29)
102private static unsafe int SysRead(SafeSocketHandle handle, Span<byte> buffer, out Interop.Error errno) 117private static unsafe int SysReceive(SafeSocketHandle socket, SocketFlags flags, Span<byte> buffer, out Interop.Error errno) 141private static unsafe int SysReceive(SafeSocketHandle socket, SocketFlags flags, Span<byte> buffer, Span<byte> socketAddress, out int socketAddressLen, out SocketFlags receivedFlags, out Interop.Error errno) 291Span<GCHandle> handles = allocOnStack ? stackalloc GCHandle[IovStackThreshold] : new GCHandle[maxBuffers]; 292Span<Interop.Sys.IOVector> iovecs = allocOnStack ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[maxBuffers]; 372private static unsafe int SysReceive(SafeSocketHandle socket, SocketFlags flags, IList<ArraySegment<byte>> buffers, Span<byte> socketAddress, out int socketAddressLen, out SocketFlags receivedFlags, out Interop.Error errno) 398Span<GCHandle> handles = allocOnStack ? stackalloc GCHandle[IovStackThreshold] : new GCHandle[maxBuffers]; 399Span<Interop.Sys.IOVector> iovecs = allocOnStack ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[maxBuffers]; 470private static unsafe int SysReceiveMessageFrom(SafeSocketHandle socket, SocketFlags flags, Span<byte> buffer, Span<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, out SocketFlags receivedFlags, out IPPacketInformation ipPacketInformation, out Interop.Error errno) 527Span<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, 534Span<GCHandle> handles = allocOnStack ? stackalloc GCHandle[IovStackThreshold] : new GCHandle[buffersCount]; 535Span<Interop.Sys.IOVector> iovecs = allocOnStack ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[buffersCount]; 736public static bool TryCompleteReceiveFrom(SafeSocketHandle socket, Span<byte> buffer, SocketFlags flags, Span<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out SocketFlags receivedFlags, out SocketError errorCode) => 739public static bool TryCompleteReceiveFrom(SafeSocketHandle socket, IList<ArraySegment<byte>> buffers, SocketFlags flags, Span<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out SocketFlags receivedFlags, out SocketError errorCode) => 740TryCompleteReceiveFrom(socket, default(Span<byte>), buffers, flags, socketAddress, out socketAddressLen, out bytesReceived, out receivedFlags, out errorCode); 742public static unsafe bool TryCompleteReceive(SafeSocketHandle socket, Span<byte> buffer, SocketFlags flags, out int bytesReceived, out SocketError errorCode) 801public static unsafe bool TryCompleteReceiveFrom(SafeSocketHandle socket, Span<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, Span<byte> socketAddress, out int receivedSocketAddressLength, out int bytesReceived, out SocketFlags receivedFlags, out SocketError errorCode) 872public static unsafe bool TryCompleteReceiveMessageFrom(SafeSocketHandle socket, Span<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, Memory<byte> socketAddress, out int receivedSocketAddressLength, bool isIPv4, bool isIPv6, out int bytesReceived, out SocketFlags receivedFlags, out IPPacketInformation ipPacketInformation, out SocketError errorCode) 918public static bool TryCompleteSendTo(SafeSocketHandle socket, Span<byte> buffer, ref int offset, ref int count, SocketFlags flags, ReadOnlySpan<byte> socketAddress, ref int bytesSent, out SocketError errorCode) 1074public static unsafe SocketError GetPeerName(SafeSocketHandle handle, Span<byte> buffer, ref int nameLen) 1238if (!TryCompleteReceiveFrom(handle, buffers, socketFlags, Span<byte>.Empty, out int _, out bytesTransferred, out _, out errorCode)) 1259public static SocketError Receive(SafeSocketHandle handle, Span<byte> buffer, SocketFlags socketFlags, out int bytesTransferred) 1297public static SocketError ReceiveMessageFrom(Socket socket, SafeSocketHandle handle, Span<byte> buffer, ref SocketFlags socketFlags, SocketAddress socketAddress, out SocketAddress receiveAddress, out IPPacketInformation ipPacketInformation, out int bytesTransferred) 1334public static SocketError ReceiveFrom(SafeSocketHandle handle, Span<byte> buffer, SocketFlags socketFlags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesTransferred) 1628public static unsafe SocketError GetRawSockOpt(SafeSocketHandle handle, int optionLevel, int optionName, Span<byte> optionValue, ref int optionLength)
System.Net.WebClient (6)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
95public override int Read(Span<byte> buffer)
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
178Span<char> url = lengthRequired <= 256 ? stackalloc char[256] : new char[lengthRequired];
System.Net.WebSockets (12)
System\Net\WebSockets\Compression\WebSocketDeflater.cs (3)
79private void DeflatePrivate(ReadOnlySpan<byte> payload, Span<byte> output, bool endOfMessage, 122private unsafe void UnsafeDeflate(ReadOnlySpan<byte> input, Span<byte> output, out int consumed, out int written, out bool needsMoreBuffer) 153private unsafe int UnsafeFlush(Span<byte> output, out bool needsMoreBuffer)
System\Net\WebSockets\Compression\WebSocketInflater.cs (4)
57public Span<byte> Span => _buffer.AsSpan(_position + _available); 126public unsafe bool Inflate(Span<byte> output, out int written) 164private unsafe bool Finish(Span<byte> output, ref int written) 228private static unsafe int Inflate(ZLibStreamHandle stream, Span<byte> destination, FlushCode flushCode)
System\Net\WebSockets\ManagedWebSocket.cs (5)
1145Span<byte> receiveBufferSpan = _receiveBuffer.Span; 1466private static int CombineMaskBytes(Span<byte> buffer, int maskOffset) => 1475private static int ApplyMask(Span<byte> toMask, byte[] mask, int maskOffset, int maskOffsetIndex) 1487private static unsafe int ApplyMask(Span<byte> toMask, int mask, int maskIndex) 1558private static bool TryValidateUtf8(Span<byte> span, bool endOfMessage, Utf8MessageState state)
System.Net.WebSockets.Client (1)
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
489Span<byte> bytes = stackalloc byte[24 /* Base64 guid length */ + wsServerGuidBytes.Length];
System.Numerics.Tensors (190)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBinaryOperator.cs (4)
34T x, ReadOnlySpan<T> y, Span<T> destination) 47ReadOnlySpan<T> x, T y, Span<T> destination) 60ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 1398ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IStatefulUnaryOperator.cs (1)
29ReadOnlySpan<T> x, TStatefulUnaryOperator op, Span<T> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.ITernaryOperator.cs (3)
34ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> z, Span<T> destination) 1511ReadOnlySpan<T> x, ReadOnlySpan<T> y, T z, Span<T> destination) 2990ReadOnlySpan<T> x, T y, ReadOnlySpan<T> z, Span<T> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryInputBinaryOutput.cs (2)
26ReadOnlySpan<T> x, Span<T> destination1, Span<T> destination2)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToTwoOperator.cs (1)
32ReadOnlySpan<TInput> x, Span<TOutput> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOperator.cs (2)
56ReadOnlySpan<T> x, Span<T> destination) 69ReadOnlySpan<TInput> x, Span<TOutput> destination)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryTwoToOneOperator.cs (1)
32ReadOnlySpan<TInput> x, Span<TOutput> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Abs.cs (1)
29public static void Abs<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Acos.cs (1)
24public static void Acos<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Acosh.cs (1)
24public static void Acosh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.AcosPi.cs (1)
24public static void AcosPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Add.cs (2)
26public static void Add<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 44public static void Add<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.AddMultiply.cs (3)
28public static void AddMultiply<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> multiplier, Span<T> destination) 49public static void AddMultiply<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T multiplier, Span<T> destination) 70public static void AddMultiply<T>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> multiplier, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Asin.cs (1)
24public static void Asin<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Asinh.cs (1)
24public static void Asinh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.AsinPi.cs (1)
24public static void AsinPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Atan.cs (1)
24public static void Atan<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Atan2.cs (3)
27public static void Atan2<T>(ReadOnlySpan<T> y, ReadOnlySpan<T> x, Span<T> destination) 46public static void Atan2<T>(ReadOnlySpan<T> y, T x, Span<T> destination) 65public static void Atan2<T>(T y, ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Atan2Pi.cs (3)
27public static void Atan2Pi<T>(ReadOnlySpan<T> y, ReadOnlySpan<T> x, Span<T> destination) 46public static void Atan2Pi<T>(ReadOnlySpan<T> y, T x, Span<T> destination) 65public static void Atan2Pi<T>(T y, ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Atanh.cs (1)
24public static void Atanh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.AtanPi.cs (1)
24public static void AtanPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.BitwiseAnd.cs (2)
23public static void BitwiseAnd<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 38public static void BitwiseAnd<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.BitwiseOr.cs (2)
23public static void BitwiseOr<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 38public static void BitwiseOr<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Cbrt.cs (1)
21public static void Cbrt<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Ceiling.cs (1)
21public static void Ceiling<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertChecked.cs (1)
22public static void ConvertChecked<TFrom, TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertHelpers.cs (1)
17private static bool TryConvertUniversal<TFrom, TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertSaturating.cs (1)
22public static void ConvertSaturating<TFrom, TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertTruncating.cs (1)
22public static void ConvertTruncating<TFrom, TTo>(ReadOnlySpan<TFrom> source, Span<TTo> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.CopySign.cs (2)
23public static void CopySign<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> sign, Span<T> destination) 38public static void CopySign<T>(ReadOnlySpan<T> x, T sign, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Cos.cs (1)
28public static void Cos<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Cosh.cs (1)
32public static void Cosh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.CosPi.cs (1)
28public static void CosPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.DegreesToRadians.cs (1)
20public static void DegreesToRadians<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Divide.cs (3)
27public static void Divide<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 46public static void Divide<T>(ReadOnlySpan<T> x, T y, Span<T> destination) 65public static void Divide<T>(T x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Exp.cs (1)
29public static void Exp<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Exp10.cs (1)
24public static void Exp10<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Exp10M1.cs (1)
24public static void Exp10M1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Exp2.cs (1)
24public static void Exp2<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Exp2M1.cs (1)
24public static void Exp2M1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ExpM1.cs (1)
24public static void ExpM1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Floor.cs (1)
21public static void Floor<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.FusedMultiplyAdd.cs (3)
37public static void FusedMultiplyAdd<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> addend, Span<T> destination) 65public static void FusedMultiplyAdd<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T addend, Span<T> destination) 92public static void FusedMultiplyAdd<T>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> addend, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Half.cs (2)
23public static void ConvertToHalf(ReadOnlySpan<float> source, Span<Half> destination) => 41public static void ConvertToSingle(ReadOnlySpan<Half> source, Span<float> destination) =>
System\Numerics\Tensors\netcore\TensorPrimitives.Hypot.cs (1)
23public static void Hypot<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Ieee754Remainder.cs (3)
23public static void Ieee754Remainder<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 39public static void Ieee754Remainder<T>(ReadOnlySpan<T> x, T y, Span<T> destination) 54public static void Ieee754Remainder<T>(T x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ILogB.cs (1)
20public static void ILogB<T>(ReadOnlySpan<T> x, Span<int> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.LeadingZeroCount.cs (1)
26public static void LeadingZeroCount<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Lerp.cs (3)
28public static void Lerp<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> amount, Span<T> destination) 49public static void Lerp<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T amount, Span<T> destination) 70public static void Lerp<T>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> amount, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Log.cs (3)
31public static void Log<T>(ReadOnlySpan<T> x, Span<T> destination) 52public static void Log<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 71public static void Log<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Log10.cs (1)
30public static void Log10<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Log10P1.cs (1)
30public static void Log10P1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Log2.cs (1)
31public static void Log2<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Log2P1.cs (1)
30public static void Log2P1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.LogP1.cs (1)
30public static void LogP1<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Max.cs (2)
52public static void Max<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 75public static void Max<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MaxMagnitude.cs (2)
45public static void MaxMagnitude<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 62public static void MaxMagnitude<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MaxNumber.cs (2)
52public static void MaxNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 75public static void MaxNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Min.cs (2)
33public static void Min<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 56public static void Min<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MinMagnitude.cs (2)
50public static void MinMagnitude<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 72public static void MinMagnitude<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MinNumber.cs (2)
52public static void MinNumber<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 75public static void MinNumber<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Multiply.cs (2)
26public static void Multiply<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 45public static void Multiply<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MultiplyAdd.cs (3)
28public static void MultiplyAdd<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> addend, Span<T> destination) 50public static void MultiplyAdd<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T addend, Span<T> destination) 71public static void MultiplyAdd<T>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> addend, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.MultiplyAddEstimate.cs (9)
31/// Behaves the same as either <see cref="MultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, ReadOnlySpan{T}, Span{T})"/> or 32/// <see cref="FusedMultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, ReadOnlySpan{T}, Span{T})"/> depending on the current machine's capabilities. 35public static void MultiplyAddEstimate<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, ReadOnlySpan<T> addend, Span<T> destination) 57/// Behaves the same as either <see cref="MultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, T, Span{T})"/> or 58/// <see cref="FusedMultiplyAdd{T}(ReadOnlySpan{T}, ReadOnlySpan{T}, T, Span{T})"/> depending on the current machine's capabilities. 61public static void MultiplyAddEstimate<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, T addend, Span<T> destination) 82/// Behaves the same as either <see cref="MultiplyAdd{T}(ReadOnlySpan{T}, T, ReadOnlySpan{T}, Span{T})"/> or 83/// <see cref="FusedMultiplyAdd{T}(ReadOnlySpan{T}, T, ReadOnlySpan{T}, Span{T})"/> depending on the current machine's capabilities. 86public static void MultiplyAddEstimate<T>(ReadOnlySpan<T> x, T y, ReadOnlySpan<T> addend, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Negate.cs (1)
23public static void Negate<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.OnesComplement.cs (1)
20public static void OnesComplement<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.PopCount.cs (1)
26public static void PopCount<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Pow.cs (3)
24public static void Pow<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 39public static void Pow<T>(ReadOnlySpan<T> x, T y, Span<T> destination) 54public static void Pow<T>(T x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.RadiansToDegrees.cs (1)
20public static void RadiansToDegrees<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Reciprocal.cs (4)
23public static void Reciprocal<T>(ReadOnlySpan<T> x, Span<T> destination) 38public static void ReciprocalEstimate<T>(ReadOnlySpan<T> x, Span<T> destination) 53public static void ReciprocalSqrt<T>(ReadOnlySpan<T> x, Span<T> destination) 68public static void ReciprocalSqrtEstimate<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.RootN.cs (1)
22public static void RootN<T>(ReadOnlySpan<T> x, int n, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Rotate.cs (2)
23public static void RotateLeft<T>(ReadOnlySpan<T> x, int rotateAmount, Span<T> destination) 38public static void RotateRight<T>(ReadOnlySpan<T> x, int rotateAmount, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Round.cs (4)
24public static void Round<T>(ReadOnlySpan<T> x, Span<T> destination) 39public static void Round<T>(ReadOnlySpan<T> x, MidpointRounding mode, Span<T> destination) 80public static void Round<T>(ReadOnlySpan<T> x, int digits, Span<T> destination) where T : IFloatingPoint<T> => 97public static void Round<T>(ReadOnlySpan<T> x, int digits, MidpointRounding mode, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ScaleB.cs (1)
21public static void ScaleB<T>(ReadOnlySpan<T> x, int n, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.ShiftLeft.cs (3)
21public static void ShiftLeft<T>(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination) 36public static void ShiftRightArithmetic<T>(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination) 51public static void ShiftRightLogical<T>(ReadOnlySpan<T> x, int shiftAmount, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Sigmoid.cs (1)
25public static void Sigmoid<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Sin.cs (1)
28public static void Sin<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.SinCos.cs (2)
25public static void SinCos<T>(ReadOnlySpan<T> x, Span<T> sinDestination, Span<T> cosDestination)
System\Numerics\Tensors\netcore\TensorPrimitives.SinCosPi.cs (2)
25public static void SinCosPi<T>(ReadOnlySpan<T> x, Span<T> sinPiDestination, Span<T> cosPiDestination)
System\Numerics\Tensors\netcore\TensorPrimitives.Single.netcore.cs (7)
45ReadOnlySpan<float> x, Span<float> destination) 50ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) 55ReadOnlySpan<float> x, float y, Span<float> destination) 60ReadOnlySpan<float> x, float y, Span<float> destination) 66ReadOnlySpan<float> x, ReadOnlySpan<float> y, ReadOnlySpan<float> z, Span<float> destination) 71ReadOnlySpan<float> x, ReadOnlySpan<float> y, float z, Span<float> destination) 76ReadOnlySpan<float> x, float y, ReadOnlySpan<float> z, Span<float> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Sinh.cs (1)
32public static void Sinh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.SinPi.cs (1)
28public static void SinPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.SoftMax.cs (1)
24public static void SoftMax<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Sqrt.cs (1)
20public static void Sqrt<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Subtract.cs (3)
26public static void Subtract<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 44public static void Subtract<T>(ReadOnlySpan<T> x, T y, Span<T> destination) 62public static void Subtract<T>(T x, ReadOnlySpan<T> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Tan.cs (1)
28public static void Tan<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Tanh.cs (1)
32public static void Tanh<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.TanPi.cs (1)
27public static void TanPi<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.TrailingZeroCount.cs (1)
25public static void TrailingZeroCount<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Truncate.cs (1)
23public static void Truncate<T>(ReadOnlySpan<T> x, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Xor.cs (2)
23public static void Xor<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> y, Span<T> destination) 38public static void Xor<T>(ReadOnlySpan<T> x, T y, Span<T> destination)
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (4)
18private static void ValidateInputOutputSpanNonOverlapping<T>(ReadOnlySpan<T> input, Span<T> output) 36private static unsafe Span<TTo> Rename<TFrom, TTo>(Span<TFrom> span) 39return *(Span<TTo>*)(&span);
System\Numerics\Tensors\TensorPrimitives.Single.cs (28)
29public static void Abs(ReadOnlySpan<float> x, Span<float> destination) => 48public static void Add(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 65public static void Add(ReadOnlySpan<float> x, float y, Span<float> destination) => 86public static void AddMultiply(ReadOnlySpan<float> x, ReadOnlySpan<float> y, ReadOnlySpan<float> multiplier, Span<float> destination) => 106public static void AddMultiply(ReadOnlySpan<float> x, ReadOnlySpan<float> y, float multiplier, Span<float> destination) => 126public static void AddMultiply(ReadOnlySpan<float> x, float y, ReadOnlySpan<float> multiplier, Span<float> destination) => 150public static void Cosh(ReadOnlySpan<float> x, Span<float> destination) => 225public static void Divide(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 242public static void Divide(ReadOnlySpan<float> x, float y, Span<float> destination) => 289public static void Exp(ReadOnlySpan<float> x, Span<float> destination) => 378public static void Log(ReadOnlySpan<float> x, Span<float> destination) => 401public static void Log2(ReadOnlySpan<float> x, Span<float> destination) => 442public static void Max(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 478public static void MaxMagnitude(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 519public static void Min(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 560public static void MinMagnitude(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 579public static void Multiply(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 597public static void Multiply(ReadOnlySpan<float> x, float y, Span<float> destination) => 618public static void MultiplyAdd(ReadOnlySpan<float> x, ReadOnlySpan<float> y, ReadOnlySpan<float> addend, Span<float> destination) => 639public static void MultiplyAdd(ReadOnlySpan<float> x, ReadOnlySpan<float> y, float addend, Span<float> destination) => 659public static void MultiplyAdd(ReadOnlySpan<float> x, float y, ReadOnlySpan<float> addend, Span<float> destination) => 675public static void Negate(ReadOnlySpan<float> x, Span<float> destination) => 798public static void Sigmoid(ReadOnlySpan<float> x, Span<float> destination) 829public static void Sinh(ReadOnlySpan<float> x, Span<float> destination) => 848public static void SoftMax(ReadOnlySpan<float> x, Span<float> destination) 883public static void Subtract(ReadOnlySpan<float> x, ReadOnlySpan<float> y, Span<float> destination) => 900public static void Subtract(ReadOnlySpan<float> x, float y, Span<float> destination) => 982public static void Tanh(ReadOnlySpan<float> x, Span<float> destination) =>
System.Private.CoreLib (1088)
src\libraries\Common\src\Interop\Interop.Utils.cs (1)
22Span<char> buffer = stackalloc char[InitialSize];
src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (1)
24Span<uint> groups = stackalloc uint[InitialGroupsLength];
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (1)
34internal ReadOnlySpan<char> GetName(Span<char> buffer)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
38Span<byte> spanBuffer = stackalloc byte[StackBufferSize];
src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (2)
43Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit 77private static string GetAndTrimString(Span<char> buffer)
src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (4)
11private readonly Span<int> _span; 13internal BitHelper(Span<int> span, bool clear) 29Span<int> span = _span; 43Span<int> span = _span;
src\libraries\Common\src\System\HexConverter.cs (7)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 112private static void EncodeToUtf16_Vector128(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 245public static bool TryDecodeFromUtf16_Vector128(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
467Span<int> thousandsSepPos = stackalloc int[4];
src\libraries\Common\src\System\Number.NumberBuffer.cs (2)
34public readonly Span<byte> Digits => new Span<byte>(DigitsPtr, DigitsLength); 44public NumberBuffer(NumberBufferKind kind, Span<byte> digits)
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (2)
251Span<Range> parts = stackalloc Range[5]; 261Span<ushort> versionNumbers = stackalloc ushort[4] { ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue };
src\libraries\Common\src\System\Sha1ForNonSecretPurposes.cs (1)
78public void Finish(Span<byte> output)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (3)
16private Span<byte> _bytes; 18public ValueUtf8Converter(Span<byte> initialBuffer) 24public Span<byte> ConvertAndTerminateString(ReadOnlySpan<char> value)
src\libraries\System.Private.CoreLib\src\System\Action.cs (2)
38public delegate void SpanAction<T, in TArg>(Span<T> span, TArg arg); 41internal delegate TResult SpanFunc<TSpan, in T1, in T2, in T3, out TResult>(Span<TSpan> span, T1 arg1, T2 arg2, T3 arg3);
src\libraries\System.Private.CoreLib\src\System\Array.cs (7)
2107Span<T> keysSpan = UnsafeArrayAsSpan<T>(keys, adjustedIndex, length); 2130var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2179var span = new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), length); 2203var spanKeys = new Span<TKey>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(keys), index), length); 2204var spanItems = new Span<TValue>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(items), index), length); 2221var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2691private static Span<T> UnsafeArrayAsSpan<T>(Array array, int adjustedIndex, int length) =>
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (14)
45public static bool TryWriteBytes(Span<byte> destination, bool value) 72public static bool TryWriteBytes(Span<byte> destination, char value) 99public static bool TryWriteBytes(Span<byte> destination, short value) 126public static bool TryWriteBytes(Span<byte> destination, int value) 153public static bool TryWriteBytes(Span<byte> destination, long value) 180public static bool TryWriteBytes(Span<byte> destination, Int128 value) 209public static bool TryWriteBytes(Span<byte> destination, ushort value) 238public static bool TryWriteBytes(Span<byte> destination, uint value) 267public static bool TryWriteBytes(Span<byte> destination, ulong value) 296public static bool TryWriteBytes(Span<byte> destination, UInt128 value) 323public static unsafe bool TryWriteBytes(Span<byte> destination, Half value) 350public static bool TryWriteBytes(Span<byte> destination, float value) 377public static bool TryWriteBytes(Span<byte> destination, double value) 808var dst = new Span<char>(ref result.GetRawStringData(), result.Length);
src\libraries\System.Private.CoreLib\src\System\Boolean.cs (1)
95public bool TryFormat(Span<char> destination, out int charsWritten)
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (20)
201public static void ReverseEndianness(ReadOnlySpan<ushort> source, Span<ushort> destination) => 204/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 205public static void ReverseEndianness(ReadOnlySpan<short> source, Span<short> destination) => 208/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 210public static void ReverseEndianness(ReadOnlySpan<uint> source, Span<uint> destination) => 213/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 214public static void ReverseEndianness(ReadOnlySpan<int> source, Span<int> destination) => 217/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 219public static void ReverseEndianness(ReadOnlySpan<ulong> source, Span<ulong> destination) => 222/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 223public static void ReverseEndianness(ReadOnlySpan<long> source, Span<long> destination) => 226/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 228public static void ReverseEndianness(ReadOnlySpan<nuint> source, Span<nuint> destination) => 235/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 236public static void ReverseEndianness(ReadOnlySpan<nint> source, Span<nint> destination) => 285private static void ReverseEndianness<T, TReverser>(ReadOnlySpan<T> source, Span<T> destination) 373/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 375public static void ReverseEndianness(ReadOnlySpan<UInt128> source, Span<UInt128> destination) => 378/// <inheritdoc cref="ReverseEndianness(ReadOnlySpan{ushort}, Span{ushort})" /> 379public static void ReverseEndianness(ReadOnlySpan<Int128> source, Span<Int128> destination)
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteBigEndian.cs (26)
21public static void WriteDoubleBigEndian(Span<byte> destination, double value) 44public static void WriteHalfBigEndian(Span<byte> destination, Half value) 67public static void WriteInt16BigEndian(Span<byte> destination, short value) 90public static void WriteInt32BigEndian(Span<byte> destination, int value) 113public static void WriteInt64BigEndian(Span<byte> destination, long value) 136public static void WriteInt128BigEndian(Span<byte> destination, Int128 value) 159public static void WriteIntPtrBigEndian(Span<byte> destination, nint value) 182public static void WriteSingleBigEndian(Span<byte> destination, float value) 206public static void WriteUInt16BigEndian(Span<byte> destination, ushort value) 230public static void WriteUInt32BigEndian(Span<byte> destination, uint value) 254public static void WriteUInt64BigEndian(Span<byte> destination, ulong value) 278public static void WriteUInt128BigEndian(Span<byte> destination, UInt128 value) 302public static void WriteUIntPtrBigEndian(Span<byte> destination, nuint value) 325public static bool TryWriteDoubleBigEndian(Span<byte> destination, double value) 346public static bool TryWriteHalfBigEndian(Span<byte> destination, Half value) 367public static bool TryWriteInt16BigEndian(Span<byte> destination, short value) 388public static bool TryWriteInt32BigEndian(Span<byte> destination, int value) 409public static bool TryWriteInt64BigEndian(Span<byte> destination, long value) 430public static bool TryWriteInt128BigEndian(Span<byte> destination, Int128 value) 451public static bool TryWriteIntPtrBigEndian(Span<byte> destination, nint value) 472public static bool TryWriteSingleBigEndian(Span<byte> destination, float value) 494public static bool TryWriteUInt16BigEndian(Span<byte> destination, ushort value) 516public static bool TryWriteUInt32BigEndian(Span<byte> destination, uint value) 538public static bool TryWriteUInt64BigEndian(Span<byte> destination, ulong value) 560public static bool TryWriteUInt128BigEndian(Span<byte> destination, UInt128 value) 582public static bool TryWriteUIntPtrBigEndian(Span<byte> destination, nuint value)
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteLittleEndian.cs (26)
21public static void WriteDoubleLittleEndian(Span<byte> destination, double value) 44public static void WriteHalfLittleEndian(Span<byte> destination, Half value) 67public static void WriteInt16LittleEndian(Span<byte> destination, short value) 90public static void WriteInt32LittleEndian(Span<byte> destination, int value) 113public static void WriteInt64LittleEndian(Span<byte> destination, long value) 136public static void WriteInt128LittleEndian(Span<byte> destination, Int128 value) 159public static void WriteIntPtrLittleEndian(Span<byte> destination, nint value) 182public static void WriteSingleLittleEndian(Span<byte> destination, float value) 206public static void WriteUInt16LittleEndian(Span<byte> destination, ushort value) 230public static void WriteUInt32LittleEndian(Span<byte> destination, uint value) 254public static void WriteUInt64LittleEndian(Span<byte> destination, ulong value) 278public static void WriteUInt128LittleEndian(Span<byte> destination, UInt128 value) 302public static void WriteUIntPtrLittleEndian(Span<byte> destination, nuint value) 325public static bool TryWriteDoubleLittleEndian(Span<byte> destination, double value) 346public static bool TryWriteHalfLittleEndian(Span<byte> destination, Half value) 367public static bool TryWriteInt16LittleEndian(Span<byte> destination, short value) 388public static bool TryWriteInt32LittleEndian(Span<byte> destination, int value) 409public static bool TryWriteInt64LittleEndian(Span<byte> destination, long value) 430public static bool TryWriteInt128LittleEndian(Span<byte> destination, Int128 value) 451public static bool TryWriteIntPtrLittleEndian(Span<byte> destination, nint value) 472public static bool TryWriteSingleLittleEndian(Span<byte> destination, float value) 494public static bool TryWriteUInt16LittleEndian(Span<byte> destination, ushort value) 516public static bool TryWriteUInt32LittleEndian(Span<byte> destination, uint value) 538public static bool TryWriteUInt64LittleEndian(Span<byte> destination, ulong value) 560public static bool TryWriteUInt128LittleEndian(Span<byte> destination, UInt128 value) 582public static bool TryWriteUIntPtrLittleEndian(Span<byte> destination, nuint value)
src\libraries\System.Private.CoreLib\src\System\Buffers\MemoryManager.cs (1)
21public abstract Span<T> GetSpan();
src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (2)
158internal Span<char> Format(Span<char> destination)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Decoder.cs (9)
37public static OperationStatus DecodeFromUtf8(ReadOnlySpan<byte> utf8, Span<byte> bytes, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) => 40private static unsafe OperationStatus DecodeFromUtf8(ReadOnlySpan<byte> utf8, Span<byte> bytes, out int bytesConsumed, out int bytesWritten, bool isFinalBlock, bool ignoreWhiteSpace) 282static OperationStatus InvalidDataFallback(ReadOnlySpan<byte> utf8, Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock) 365public static OperationStatus DecodeFromUtf8InPlace(Span<byte> buffer, out int bytesWritten) => 368private static unsafe OperationStatus DecodeFromUtf8InPlace(Span<byte> buffer, out int bytesWritten, bool ignoreWhiteSpace) 473private static OperationStatus DecodeWithWhiteSpaceBlockwise(ReadOnlySpan<byte> utf8, Span<byte> bytes, ref int bytesConsumed, ref int bytesWritten, bool isFinalBlock = true) 476Span<byte> buffer = stackalloc byte[BlockSize]; 571private static OperationStatus DecodeWithWhiteSpaceFromUtf8InPlace(Span<byte> utf8, ref int destIndex, uint sourceIndex) 574Span<byte> buffer = stackalloc byte[BlockSize];
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Encoder.cs (2)
38public static unsafe OperationStatus EncodeToUtf8(ReadOnlySpan<byte> bytes, Span<byte> utf8, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) 192public static unsafe OperationStatus EncodeToUtf8InPlace(Span<byte> buffer, int dataLength, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\FormattingHelpers.cs (1)
11public static bool TryFormat<T>(T value, Span<byte> utf8Destination, out int bytesWritten, StandardFormat format) where T : IUtf8SpanFormattable
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Boolean.cs (1)
27public static bool TryFormat(bool value, Span<byte> destination, out int bytesWritten, StandardFormat format = default)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (3)
33public static bool TryFormat(DateTimeOffset value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) 81public static bool TryFormat(DateTime value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) 104private static bool TryFormatDateTimeL(DateTime value, Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Decimal.cs (1)
28public static bool TryFormat(decimal value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) =>
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Float.cs (2)
28public static bool TryFormat(double value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 51public static bool TryFormat(float value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) =>
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Guid.cs (1)
29public static bool TryFormat(Guid value, Span<byte> destination, out int bytesWritten, StandardFormat format = default)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Integer.cs (9)
34public static bool TryFormat(byte value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 59public static bool TryFormat(sbyte value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 84public static bool TryFormat(ushort value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 108public static bool TryFormat(short value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 134public static bool TryFormat(uint value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) 186public static bool TryFormat(int value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) => 190private static bool TryFormat(int value, int hexMask, Span<byte> destination, out int bytesWritten, StandardFormat format = default) 248public static bool TryFormat(ulong value, Span<byte> destination, out int bytesWritten, StandardFormat format = default) 301public static bool TryFormat(long value, Span<byte> destination, out int bytesWritten, StandardFormat format = default)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.TimeSpan.cs (1)
30public static bool TryFormat(TimeSpan value, Span<byte> destination, out int bytesWritten, StandardFormat format = default)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Number.cs (1)
32Span<byte> digits = number.Digits;
src\libraries\System.Private.CoreLib\src\System\Byte.cs (6)
162public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 168public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 368/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 369bool IBinaryInteger<byte>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 386/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 387bool IBinaryInteger<byte>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Char.cs (6)
177bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) 191bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 1281/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 1282bool IBinaryInteger<char>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 1299/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 1300bool IBinaryInteger<char>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (53)
19public void Sort(Span<T> keys, IComparer<T>? comparer) 54internal static void Sort(Span<T> keys, Comparison<T> comparer) 99private static void SwapIfGreater(Span<T> keys, Comparison<T> comparer, int i, int j) 112private static void Swap(Span<T> a, int i, int j) 121internal static void IntrospectiveSort(Span<T> keys, Comparison<T> comparer) 134private static void IntroSort(Span<T> keys, int depthLimit, Comparison<T> comparer) 179private static int PickPivotAndPartition(Span<T> keys, Comparison<T> comparer) 217private static void HeapSort(Span<T> keys, Comparison<T> comparer) 235private static void DownHeap(Span<T> keys, int i, int n, Comparison<T> comparer) 258private static void InsertionSort(Span<T> keys, Comparison<T> comparer) 283public void Sort(Span<T> keys, IComparer<T>? comparer) 298int nanLeft = SortUtils.MoveNansToFront(keys, default(Span<byte>)); 411private static void IntroSort(Span<T> keys, int depthLimit) 458private static unsafe int PickPivotAndPartition(Span<T> keys) 508private static void HeapSort(Span<T> keys) 525private static void DownHeap(Span<T> keys, int i, int n) 546private static void InsertionSort(Span<T> keys) 616public void Sort(Span<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 634private static void SwapIfGreaterWithValues(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j) 654private static void Swap(Span<TKey> keys, Span<TValue> values, int i, int j) 667internal static void IntrospectiveSort(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 678private static void IntroSort(Span<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer) 724private static int PickPivotAndPartition(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 762private static void HeapSort(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 780private static void DownHeap(Span<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer) 807private static void InsertionSort(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer) 833public void Sort(Span<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer) 877private static void SwapIfGreaterWithValues(Span<TKey> keys, Span<TValue> values, int i, int j) 895private static void Swap(Span<TKey> keys, Span<TValue> values, int i, int j) 908private static void IntroSort(Span<TKey> keys, Span<TValue> values, int depthLimit) 953private static int PickPivotAndPartition(Span<TKey> keys, Span<TValue> values) 998private static void HeapSort(Span<TKey> keys, Span<TValue> values) 1015private static void DownHeap(Span<TKey> keys, Span<TValue> values, int i, int n) 1040private static void InsertionSort(Span<TKey> keys, Span<TValue> values) 1112public static int MoveNansToFront<TKey, TValue>(Span<TKey> keys, Span<TValue> values) where TKey : notnull
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (1)
154public static void CopyTo<T>(this List<T> list, Span<T> destination)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (4)
1259Span<int> span = stackalloc int[StackAllocThreshold]; 1327Span<int> itemsToRemoveSpan = stackalloc int[StackAllocThreshold / 2]; 1332Span<int> itemsAddedFromOtherSpan = stackalloc int[StackAllocThreshold / 2]; 1415Span<int> span = stackalloc int[StackAllocThreshold];
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T> initialSpan) 49Span<T> span = _span; 65Span<T> span = _span; 104public Span<T> AppendSpan(int length) 109Span<T> span = _span; 122private Span<T> AppendSpanWithGrow(int length) 146public bool TryCopyTo(Span<T> destination, out int itemsWritten)
src\libraries\System.Private.CoreLib\src\System\Convert.Base64.cs (1)
31private static bool TryDecodeFromUtf16(ReadOnlySpan<char> utf16, Span<byte> bytes, out int consumed, out int written)
src\libraries\System.Private.CoreLib\src\System\Convert.cs (11)
2300Span<char> chars = stackalloc char[22]; // max length of a ulong in octal 2429public static unsafe bool TryToBase64Chars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten, Base64FormattingOptions options = Base64FormattingOptions.None) 2473private static unsafe void ToBase64CharsLargeNoLineBreaks(ReadOnlySpan<byte> bytes, Span<char> chars, int charLengthRequired) 2659public static bool TryFromBase64String(string s, Span<byte> bytes, out int bytesWritten) 2669public static bool TryFromBase64Chars(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 2673Span<char> tempBuffer = stackalloc char[4]; // Note: The tempBuffer size could be made larger than 4 but the size must be a multiple of 4. 2763private static void CopyToTempBufferWithoutWhiteSpace(ReadOnlySpan<char> chars, Span<char> tempBuffer, out int consumed, out int charsWritten) 2971public static OperationStatus FromHexString(string source, Span<byte> destination, out int charsConsumed, out int bytesWritten) 2990public static OperationStatus FromHexString(ReadOnlySpan<char> source, Span<byte> destination, out int charsConsumed, out int bytesWritten) 3087public static bool TryToHexString(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 3164public static bool TryToHexStringLower(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten)
src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (3)
790public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 794public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 797private bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format, IFormatProvider? provider = null)
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (2)
1805public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 1809public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) =>
src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (2)
862public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null) => 866public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null) =>
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (13)
502public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 508public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 591public static int GetBits(decimal d, Span<int> destination) 612public static bool TryGetBits(decimal d, Span<int> destination, out int valuesWritten) 628internal static void GetBytes(in decimal d, Span<byte> buffer) 1144/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 1145bool IFloatingPoint<decimal>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 1162/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 1163bool IFloatingPoint<decimal>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 1180/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 1181bool IFloatingPoint<decimal>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 1209/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 1210bool IFloatingPoint<decimal>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.cs (1)
120Span<EventPipeProviderConfigurationNative> providersNative = new Span<EventPipeProviderConfigurationNative>((void*)Marshal.AllocCoTaskMem(sizeof(EventPipeProviderConfigurationNative) * providers.Length), providers.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (4)
488Span<int> refObjPosition = stackalloc int[EtwAPIMaxRefObjCount]; 489Span<object?> dataRefObj = new Span<object?>(ref eightObjectStack._arg0, EtwAPIMaxRefObjCount); 528Span<object?> newDataRefObj = new object?[dataRefObj.Length * 2]; 532Span<int> newRefObjPosition = new int[refObjPosition.Length * 2];
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (3)
5482Span<char> ulongHexScratch = stackalloc char[16]; // long enough for ulong.MaxValue formatted as hex 5579Span<char> hexValueFormatted = ulongHexScratch.Slice(0, charsWritten); 5626Span<char> keywordFormatted = ulongHexScratch.Slice(0, charsWritten);
src\libraries\System.Private.CoreLib\src\System\Double.cs (10)
375public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 381public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 725/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 726bool IFloatingPoint<double>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 749/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 750bool IFloatingPoint<double>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 773/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 774bool IFloatingPoint<double>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 797/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 798bool IFloatingPoint<double>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Enum.cs (12)
1555private static bool TryFormatNumberAsHex<TStorage>(ref byte data, Span<char> destination, out int charsWritten) where TStorage : struct 1689bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) 1749public static unsafe bool TryFormat<TEnum>(TEnum value, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.EnumFormat)] ReadOnlySpan<char> format = default) where TEnum : struct 1805internal static unsafe bool TryFormatUnconstrained<TEnum>(TEnum value, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.EnumFormat)] ReadOnlySpan<char> format = default) 1858private static bool TryFormatPrimitiveDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten) 1893private static bool TryFormatPrimitiveNonDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format) 1944Span<int> foundItems = stackalloc int[64]; 1963private static bool TryFormatFlagNames<TStorage>(EnumInfo<TStorage> enumInfo, TStorage resultValue, Span<char> destination, out int charsWritten, ref bool isDestinationTooSmall) 1988Span<int> foundItems = stackalloc int[64]; 2063private static bool TryFindFlagsNames<TStorage>(TStorage resultValue, string[] names, TStorage[] values, int index, Span<int> foundItems, out int resultLength, out int foundItemsCount) 2109private static void WriteMultipleFoundFlagsNames(string[] names, ReadOnlySpan<int> foundItems, Span<char> destination) 2118Span<char> afterSeparator = destination.Slice(2); // done before copying ", " to eliminate those two bounds checks
src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Windows.cs (1)
36Span<char> span = stackalloc char[128];
src\libraries\System.Private.CoreLib\src\System\Exception.cs (2)
152Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 180static void Write(string source, ref Span<char> dest)
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (1)
182Span<char> modifiedPattern = stackalloc char[s.Length + 2];
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (5)
163Span<char> valueAsUtf16 = stackalloc char[Rune.MaxUtf16CharsPerRune]; 1046Span<char> valueAsUtf16 = stackalloc char[Rune.MaxUtf16CharsPerRune]; 1422Span<char> valueAsUtf16 = stackalloc char[Rune.MaxUtf16CharsPerRune]; 1472public int GetSortKey(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options = CompareOptions.None) 1489private int GetSortKeyCore(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options) =>
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (2)
756private unsafe int IcuGetSortKey(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options) 892Span<byte> sortKey = sortKeyLength <= 1024
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Invariant.cs (3)
44private static void InvariantCreateSortKeyOrdinal(ReadOnlySpan<char> source, Span<byte> sortKey) 56private static void InvariantCreateSortKeyOrdinalIgnoreCase(ReadOnlySpan<char> source, Span<byte> sortKey) 83private static int InvariantGetSortKey(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options)
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (2)
156Span<byte> span = sortKeyLength <= 512 ? 423private unsafe int NlsGetSortKey(ReadOnlySpan<char> source, Span<byte> destination, CompareOptions options)
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (1)
735Span<char> normalizedName = stackalloc char[name.Length];
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (2)
39Span<char> buffer = stackalloc char[ICU_ULOC_FULLNAME_CAPACITY]; 341Span<char> result = stackalloc char[ICU_ULOC_FULLNAME_CAPACITY];
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (13)
777Span<TChar> chars = stackalloc TChar[11]; 977Span<char> span = stackalloc char[FormatOMaxLength]; 1029internal static bool TryFormat<TChar>(DateTime dateTime, Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) where TChar : unmanaged, IUtfChar<TChar> => 1032internal static bool TryFormat<TChar>(DateTime dateTime, Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider, TimeSpan offset) where TChar : unmanaged, IUtfChar<TChar> 1316internal static unsafe bool TryFormatTimeOnlyO<TChar>(int hour, int minute, int second, long fraction, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1343internal static unsafe bool TryFormatTimeOnlyR<TChar>(int hour, int minute, int second, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1369internal static unsafe bool TryFormatDateOnlyO<TChar>(int year, int month, int day, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1395internal static unsafe bool TryFormatDateOnlyR<TChar>(DayOfWeek dayOfWeek, int year, int month, int day, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1439internal static unsafe bool TryFormatO<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1519internal static unsafe bool TryFormatS<TChar>(DateTime dateTime, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1554internal static unsafe bool TryFormatu<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1595internal static unsafe bool TryFormatR<TChar>(DateTime dateTime, TimeSpan offset, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1660internal static unsafe bool TryFormatInvariantG<TChar>(DateTime value, TimeSpan offset, Span<TChar> destination, out int bytesWritten) where TChar : unmanaged, IUtfChar<TChar>
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (2)
5852Span<char> result = new char[i + 1]; 5879Span<char> result = new char[Value.Length - i];
src\libraries\System.Private.CoreLib\src\System\Globalization\IcuLocaleData.cs (2)
3810Span<byte> lower_case = stackalloc byte[name.Length]; 3864var s = new Span<char>(ref result.GetRawStringData(), buffer.Length);
src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (4)
57var destination = new Span<char>(ref result.GetRawStringData(), result.Length); 103var destination = new Span<char>(ref result.GetRawStringData(), result.Length); 111internal static void ToUpper(ReadOnlySpan<char> source, Span<char> destination) 137internal static void ToLower(ReadOnlySpan<char> source, Span<char> destination)
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Nls.cs (1)
192Span<Range> names = stackalloc Range[5];
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (1)
53Span<char> buffer = strInput.Length <= StackallocThreshold
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (1)
72Span<char> buffer = strInput.Length <= StackallocThreshold
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (1)
686internal static int ToUpperOrdinal(ReadOnlySpan<char> source, Span<char> destination)
src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (2)
148public static void ToUpperInvariantMode(this ReadOnlySpan<char> source, Span<char> destination) 156internal static void ToUpperOrdinal(ReadOnlySpan<char> source, Span<char> destination)
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (6)
212internal void ChangeCaseToLower(ReadOnlySpan<char> source, Span<char> destination) 219internal void ChangeCaseToUpper(ReadOnlySpan<char> source, Span<char> destination) 226private unsafe void ChangeCaseCommon<TConversion>(ReadOnlySpan<char> source, Span<char> destination) where TConversion : struct 331Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 350Span<char> resultSpan = new Span<char>(ref result.GetRawStringData(), result.Length); 661Span<char> dst = stackalloc char[2];
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (4)
51internal static bool TryFormat<TChar>(TimeSpan value, Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? formatProvider) where TChar : unmanaged, IUtfChar<TChar> 86Span<char> destination = stackalloc char[26]; // large enough for any "c" TimeSpan 95Span<char> destination = maxLength < 128 ? 109internal static unsafe bool TryFormatStandard<TChar>(TimeSpan value, StandardFormat format, ReadOnlySpan<TChar> decimalSeparator, Span<TChar> destination, out int written) where TChar : unmanaged, IUtfChar<TChar>
src\libraries\System.Private.CoreLib\src\System\Guid.cs (11)
440Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 526Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 880public bool TryWriteBytes(Span<byte> destination) 899public bool TryWriteBytes(Span<byte> destination, bool bigEndian, out int bytesWritten) 1177public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format = default) => 1180bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format, IFormatProvider? provider) => 1184public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format = default) => 1187bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format, IFormatProvider? provider) => 1200private bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format) where TChar : unmanaged, IUtfChar<TChar> 1247internal unsafe bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, int flags) where TChar : unmanaged, IUtfChar<TChar> 1372private unsafe bool TryFormatX<TChar>(Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
src\libraries\System.Private.CoreLib\src\System\Half.cs (10)
543public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 549public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 1367/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 1368bool IFloatingPoint<Half>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 1385/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 1386bool IFloatingPoint<Half>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 1403/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 1404bool IFloatingPoint<Half>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 1427/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 1428bool IFloatingPoint<Half>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Index.cs (1)
158Span<char> span = stackalloc char[11]; // 1 for ^ and 10 for longest possible uint value
src\libraries\System.Private.CoreLib\src\System\Int128.cs (2)
118public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 124public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null)
src\libraries\System.Private.CoreLib\src\System\Int16.cs (6)
118public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 124public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 465/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 466bool IBinaryInteger<short>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 483/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 484bool IBinaryInteger<short>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Int32.cs (6)
128public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 134public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 498/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 499bool IBinaryInteger<int>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 516/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 517bool IBinaryInteger<int>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Int64.cs (6)
125public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 131public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 495/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 496bool IBinaryInteger<long>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 513/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 514bool IBinaryInteger<long>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (6)
211public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 215public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 506/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 507bool IBinaryInteger<nint>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 529/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 530bool IBinaryInteger<nint>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (7)
126Span<byte> charBytes = stackalloc byte[MaxCharBytesSize]; 259Span<byte> charBytes = stackalloc byte[MaxCharBytesSize]; 309public virtual int Read(Span<char> buffer) 315private int InternalReadChars(Span<char> buffer) 322Span<byte> charBytes = stackalloc byte[MaxCharBytesSize]; 428public virtual int Read(Span<byte> buffer) 456private ReadOnlySpan<byte> InternalRead(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (12)
184Span<byte> buffer = stackalloc byte[8]; // reasonable guess for worst-case expansion for any arbitrary encoding 246Span<byte> buffer = stackalloc byte[sizeof(double)]; 253Span<byte> buffer = stackalloc byte[sizeof(decimal)]; 263Span<byte> buffer = stackalloc byte[sizeof(short)]; 274Span<byte> buffer = stackalloc byte[sizeof(ushort)]; 284Span<byte> buffer = stackalloc byte[sizeof(int)]; 295Span<byte> buffer = stackalloc byte[sizeof(uint)]; 305Span<byte> buffer = stackalloc byte[sizeof(long)]; 316Span<byte> buffer = stackalloc byte[sizeof(ulong)]; 326Span<byte> buffer = stackalloc byte[sizeof(float)]; 336Span<byte> buffer = stackalloc byte[sizeof(ushort) /* = sizeof(Half) */]; 359Span<byte> buffer = stackalloc byte[128];
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (2)
446private int ReadFromBuffer(Span<byte> destination) 528public override int Read(Span<byte> destination)
src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (1)
36Span<byte> path = totalByteCount <= 256 ? stackalloc byte[256].Slice(0, totalByteCount) : new byte[totalByteCount];
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (3)
17private Span<char> _pathBuffer; 34Span<char> pathBuffer) 98Span<char> buffer = MemoryMarshal.CreateSpan(ref _fileNameBuffer._buffer[0], Interop.Sys.DirectoryEntry.NameBufferSize);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemName.cs (2)
189Span<int> currentMatches = stackalloc int[16]; 190Span<int> priorMatches = stackalloc int[16];
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (3)
1227Span<byte> buffer = stackalloc byte[512]; 1289Span<byte> bytes = bytesNeeded <= 1024 ? stackalloc byte[1024] : (rentedBytes = ArrayPool<byte>.Shared.Rent(bytesNeeded)); 1309Span<byte> toStore = bytes.Slice(0, preambleSize + encoded);
src\libraries\System.Private.CoreLib\src\System\IO\FileStream.cs (2)
285public override int Read(Span<byte> buffer) => _strategy.Read(buffer); 615internal int BaseRead(Span<byte> buffer) => base.Read(buffer);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (1)
345public override int Read(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (3)
583public static bool TryJoin(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, Span<char> destination, out int charsWritten) 617public static bool TryJoin(ReadOnlySpan<char> path1, ReadOnlySpan<char> path2, ReadOnlySpan<char> path3, Span<char> destination, out int charsWritten) 796internal static unsafe void Populate83FileNameFromRandomBytes(byte* bytes, int byteCount, Span<char> chars)
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
111Span<byte> path = totalByteCount <= 256 ? stackalloc byte[256].Slice(0, totalByteCount) : new byte[totalByteCount];
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (2)
26fixed (byte* ptr = &MemoryMarshal.GetReference((Span<byte>)array)) 31public override int Read(Span<byte> buffer) => ReadCore(buffer);
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.cs (1)
67public static int Read(SafeFileHandle handle, Span<byte> buffer, long fileOffset)
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (3)
25internal static unsafe int ReadAtOffset(SafeFileHandle handle, Span<byte> buffer, long fileOffset) 64Span<Interop.Sys.IOVector> vectors = buffers.Count <= IovStackThreshold ? stackalloc Interop.Sys.IOVector[IovStackThreshold] : new Interop.Sys.IOVector[buffers.Count]; 170Span<Interop.Sys.IOVector> vectors = buffersCount <= IovStackThreshold ?
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (2)
153public override int Read(Span<byte> destination) 160private int ReadSpan(Span<byte> destination, ArraySegment<byte> arraySegment)
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\DerivedFileStreamStrategy.cs (1)
79public override int Read(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
209public sealed override int Read(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (6)
788public virtual int Read(Span<byte> buffer) 825public void ReadExactly(Span<byte> buffer) => 886public int ReadAtLeast(Span<byte> buffer, int minimumBytes, bool throwOnEndOfStream = true) 894private int ReadAtLeastCore(Span<byte> buffer, int minimumBytes, bool throwOnEndOfStream) 1055public override int Read(Span<byte> buffer) => 0; 1203public override int Read(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (6)
362public override int Read(Span<char> buffer) => 366private int ReadSpan(Span<char> buffer) 443public override int ReadBlock(Span<char> buffer) 670private int ReadBuffer(Span<char> userBuffer, out bool readToUserBuffer) 1427public override int Read(Span<char> buffer) => 0; 1436public override int ReadBlock(Span<char> buffer) => 0;
src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (2)
115public override int Read(Span<char> buffer) 145public override int ReadBlock(Span<char> buffer) => Read(buffer);
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (2)
96public virtual int Read(Span<char> buffer) 146public virtual int ReadBlock(Span<char> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (1)
463Span<int> bits = stackalloc int[4];
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (2)
342public override int Read(Span<byte> buffer) 357internal int ReadCore(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStreamWrapper.cs (1)
75public override int Read(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\ISpanFormattable.cs (1)
20bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider);
src\libraries\System.Private.CoreLib\src\System\IUtf8SpanFormattable.cs (1)
19bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider);
src\libraries\System.Private.CoreLib\src\System\Marvin.OrdinalIgnoreCase.cs (1)
86Span<char> scratch = (uint)count <= 64 ? stackalloc char[64] : (borrowedArr = ArrayPool<char>.Shared.Rent(count));
src\libraries\System.Private.CoreLib\src\System\Memory.cs (4)
16/// Memory represents a contiguous region of arbitrary memory similar to <see cref="Span{T}"/>. 17/// Unlike <see cref="Span{T}"/>, it is not a byref-like type. 266public unsafe Span<T> Span 319Span<T> memoryManagerSpan = Unsafe.As<MemoryManager<T>>(tmpObject).GetSpan();
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (115)
27public static Span<T> AsSpan<T>(this T[]? array, int start) 47public static Span<T> AsSpan<T>(this T[]? array, Index startIndex) 71public static Span<T> AsSpan<T>(this T[]? array, Range range) 318public static unsafe bool Contains<T>(this Span<T> span, T value) where T : IEquatable<T>? 401public static bool ContainsAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 406public static bool ContainsAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 411public static bool ContainsAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 416public static bool ContainsAny<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 421public static bool ContainsAny(this Span<char> span, SearchValues<string> values) => 426public static bool ContainsAnyExcept<T>(this Span<T> span, T value) where T : IEquatable<T>? => 431public static bool ContainsAnyExcept<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 436public static bool ContainsAnyExcept<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 441public static bool ContainsAnyExcept<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 446public static bool ContainsAnyExcept<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 451public static bool ContainsAnyInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 456public static bool ContainsAnyExceptInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) where T : IComparable<T> => 619public static unsafe int IndexOf<T>(this Span<T> span, T value) where T : IEquatable<T>? 657public static unsafe int IndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? 685public static unsafe int LastIndexOf<T>(this Span<T> span, T value) where T : IEquatable<T>? 728public static unsafe int LastIndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? 761public static int IndexOfAnyExcept<T>(this Span<T> span, T value) where T : IEquatable<T>? => 773public static int IndexOfAnyExcept<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 786public static int IndexOfAnyExcept<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 797public static int IndexOfAnyExcept<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 809public static int IndexOfAnyExcept<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 1070public static int LastIndexOfAnyExcept<T>(this Span<T> span, T value) where T : IEquatable<T>? => 1082public static int LastIndexOfAnyExcept<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? => 1095public static int LastIndexOfAnyExcept<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? => 1106public static int LastIndexOfAnyExcept<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 1118public static int LastIndexOfAnyExcept<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 1374public static int IndexOfAnyInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) 1440public static int IndexOfAnyExceptInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) 1506public static int LastIndexOfAnyInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) 1572public static int LastIndexOfAnyExceptInRange<T>(this Span<T> span, T lowInclusive, T highInclusive) 1649public static unsafe bool SequenceEqual<T>(this Span<T> span, ReadOnlySpan<T> other) where T : IEquatable<T>? 1669public static int SequenceCompareTo<T>(this Span<T> span, ReadOnlySpan<T> other) 1839public static unsafe int IndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? 1872public static unsafe int IndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? 1905public static int IndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 1914public static int IndexOfAny<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 1923public static int IndexOfAny(this Span<char> span, SearchValues<string> values) => 2145public static unsafe int LastIndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>? 2178public static unsafe int LastIndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>? 2211public static int LastIndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>? => 2220public static int LastIndexOfAny<T>(this Span<T> span, SearchValues<T> values) where T : IEquatable<T>? => 2448public static bool SequenceEqual<T>(this Span<T> span, ReadOnlySpan<T> other, IEqualityComparer<T>? comparer = null) => 2537public static unsafe bool StartsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? 2577public static unsafe bool EndsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? 2625public static void Reverse<T>(this Span<T> span) 2637public static Span<T> AsSpan<T>(this T[]? array) 2655public static Span<T> AsSpan<T>(this T[]? array, int start, int length) 2664public static Span<T> AsSpan<T>(this ArraySegment<T> segment) 2681public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start) 2696public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Index startIndex) 2715public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start, int length) 2731public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Range range) 2864public static void CopyTo<T>(this T[]? source, Span<T> destination) 3017public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other) 3026public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other, out int elementOffset) 3081/// Searches an entire sorted <see cref="Span{T}"/> for a value 3085/// <param name="span">The sorted <see cref="Span{T}"/> to search.</param> 3091/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 3098this Span<T> span, IComparable<T> comparable) 3104/// Searches an entire sorted <see cref="Span{T}"/> for a value 3109/// <param name="span">The sorted <see cref="Span{T}"/> to search.</param> 3115/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 3122this Span<T> span, TComparable comparable) 3129/// Searches an entire sorted <see cref="Span{T}"/> for the specified <paramref name="value"/> 3134/// <param name="span">The sorted <see cref="Span{T}"/> to search.</param> 3141/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 3148this Span<T> span, T value, TComparer comparer) 3234/// Sorts the elements in the entire <see cref="Span{T}" /> using the <see cref="IComparable{T}" /> implementation 3235/// of each element of the <see cref= "Span{T}" /> 3238/// <param name="span">The <see cref="Span{T}"/> to sort.</param> 3242public static void Sort<T>(this Span<T> span) => 3246/// Sorts the elements in the entire <see cref="Span{T}" /> using the <typeparamref name="TComparer" />. 3250/// <param name="span">The <see cref="Span{T}"/> to sort.</param> 3262public static void Sort<T, TComparer>(this Span<T> span, TComparer comparer) 3272/// Sorts the elements in the entire <see cref="Span{T}" /> using the specified <see cref="Comparison{T}" />. 3275/// <param name="span">The <see cref="Span{T}"/> to sort.</param> 3278public static void Sort<T>(this Span<T> span, Comparison<T> comparison) 3291/// based on the keys in the first <see cref="Span{TKey}" /> using the <see cref="IComparable{T}" /> 3304public static void Sort<TKey, TValue>(this Span<TKey> keys, Span<TValue> items) => 3309/// based on the keys in the first <see cref="Span{TKey}" /> using the specified comparer. 3327public static void Sort<TKey, TValue, TComparer>(this Span<TKey> keys, Span<TValue> items, TComparer comparer) 3341/// based on the keys in the first <see cref="Span{TKey}" /> using the specified comparison. 3352public static void Sort<TKey, TValue>(this Span<TKey> keys, Span<TValue> items, Comparison<TKey> comparison) 3373public static unsafe void Replace<T>(this Span<T> span, T oldValue, T newValue) where T : IEquatable<T>? 3441public static unsafe void Replace<T>(this ReadOnlySpan<T> source, Span<T> destination, T oldValue, T newValue) where T : IEquatable<T>? 3518public static int CommonPrefixLength<T>(this Span<T> span, ReadOnlySpan<T> other) => 3527public static int CommonPrefixLength<T>(this Span<T> span, ReadOnlySpan<T> other, IEqualityComparer<T>? comparer) => 3651public static int Split(this ReadOnlySpan<char> source, Span<Range> destination, char separator, StringSplitOptions options = StringSplitOptions.None) 3685public static int Split(this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<char> separator, StringSplitOptions options = StringSplitOptions.None) 3741public static int SplitAny(this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<char> separators, StringSplitOptions options = StringSplitOptions.None) 3782public static int SplitAny(this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<string> separators, StringSplitOptions options = StringSplitOptions.None) 3806ReadOnlySpan<char> source, Span<Range> destination, 3879Span<Range> destinationMinusOne = destination.Slice(0, destination.Length - 1); 3962public static int Count<T>(this Span<T> span, T value) where T : IEquatable<T>? => 4016public static int Count<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>? => 4053public static bool TryWrite(this Span<char> destination, [InterpolatedStringHandlerArgument(nameof(destination))] ref TryWriteInterpolatedStringHandler handler, out int charsWritten) 4073public static bool TryWrite(this Span<char> destination, IFormatProvider? provider, [InterpolatedStringHandlerArgument(nameof(destination), nameof(provider))] ref TryWriteInterpolatedStringHandler handler, out int charsWritten) => 4091public static bool TryWrite<TArg0>(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0) 4113public static bool TryWrite<TArg0, TArg1>(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0, TArg1 arg1) 4137public static bool TryWrite<TArg0, TArg1, TArg2>(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0, TArg1 arg1, TArg2 arg2) 4157public static bool TryWrite(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, params object?[] args) 4176public static bool TryWrite(this Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, /*params*/ ReadOnlySpan<object?> args) 4189private static bool TryWrite<TArg0, TArg1, TArg2>(Span<char> destination, IFormatProvider? provider, CompositeFormat format, out int charsWritten, TArg0 arg0, TArg1 arg1, TArg2 arg2, ReadOnlySpan<object?> args) 4250private readonly Span<char> _destination; 4267/// <summary>Creates a handler used to write an interpolated string into a <see cref="Span{Char}"/>.</summary> 4273public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, Span<char> destination, out bool shouldAppend) 4282/// <summary>Creates a handler used to write an interpolated string into a <see cref="Span{Char}"/>.</summary> 4289public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, Span<char> destination, IFormatProvider? provider, out bool shouldAppend)
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (6)
197public static int ToLower(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo? culture) 223public static int ToLowerInvariant(this ReadOnlySpan<char> source, Span<char> destination) 249public static int ToUpper(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo? culture) 275public static int ToUpperInvariant(this ReadOnlySpan<char> source, Span<char> destination) 381public static SpanRuneEnumerator EnumerateRunes(this Span<char> span) 407public static SpanLineEnumerator EnumerateLines(this Span<char> span)
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.cs (20)
74public static Span<T> Trim<T>(this Span<T> span, T trimElement) where T : IEquatable<T>? 86public static Span<T> TrimStart<T>(this Span<T> span, T trimElement) where T : IEquatable<T>? 94public static Span<T> TrimEnd<T>(this Span<T> span, T trimElement) where T : IEquatable<T>? 340public static Span<T> Trim<T>(this Span<T> span, ReadOnlySpan<T> trimElements) where T : IEquatable<T>? 364public static Span<T> TrimStart<T>(this Span<T> span, ReadOnlySpan<T> trimElements) where T : IEquatable<T>? 386public static Span<T> TrimEnd<T>(this Span<T> span, ReadOnlySpan<T> trimElements) where T : IEquatable<T>? 787public static Span<char> Trim(this Span<char> span) 798static Span<char> TrimFallback(Span<char> span) 825public static Span<char> TrimStart(this Span<char> span) 832public static Span<char> TrimEnd(this Span<char> span)
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (1)
148Span<char> encodingBuffer = output.AppendSpan(MaxInt32Digits);
src\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (1)
115private static unsafe uint Dragon4(ulong mantissa, int exponent, uint mantissaHighBitIdx, bool hasUnequalMargins, int cutoffNumber, bool isSignificantDigits, Span<byte> buffer, out int decimalExponent)
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (31)
341public static unsafe bool TryFormatDecimal<TChar>(decimal value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 405public static bool TryFormatDouble<TChar>(double value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 635public static bool TryFormatSingle<TChar>(float value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 833public static bool TryFormatHalf<TChar>(Half value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 849private static bool TryCopyTo<TChar>(string source, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 938public static bool TryFormatInt32<TChar>(int value, int hexMask, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 950static unsafe bool TryFormatInt32Slow(int value, int hexMask, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1052public static bool TryFormatUInt32<TChar>(uint value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1064static unsafe bool TryFormatUInt32Slow(uint value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1168public static bool TryFormatInt64<TChar>(long value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1182static unsafe bool TryFormatInt64Slow(long value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1284public static bool TryFormatUInt64<TChar>(ulong value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1296static unsafe bool TryFormatUInt64Slow(ulong value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1401public static bool TryFormatInt128<TChar>(Int128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1415static unsafe bool TryFormatInt128Slow(Int128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1519public static bool TryFormatUInt128<TChar>(UInt128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1531static unsafe bool TryFormatUInt128Slow(UInt128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 1639internal static unsafe bool TryNegativeInt32ToDecStr<TChar>(int value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1688internal static unsafe bool TryInt32ToHexStr<TChar>(int value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1744private static unsafe bool TryUInt32ToBinaryStr<TChar>(uint value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1963internal static unsafe bool TryUInt32ToDecStr<TChar>(uint value, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1983internal static unsafe bool TryUInt32ToDecStr<TChar>(uint value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2072internal static unsafe bool TryNegativeInt64ToDecStr<TChar>(long value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2121internal static unsafe bool TryInt64ToHexStr<TChar>(long value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2193private static unsafe bool TryUInt64ToBinaryStr<TChar>(ulong value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2391internal static unsafe bool TryUInt64ToDecStr<TChar>(ulong value, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2412internal static unsafe bool TryUInt64ToDecStr<TChar>(ulong value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2500private static unsafe bool TryNegativeInt128ToDecStr<TChar>(Int128 value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2553private static unsafe bool TryInt128ToHexStr<TChar>(Int128 value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2616private static unsafe bool TryUInt128ToBinaryStr<TChar>(Int128 value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 2753private static unsafe bool TryUInt128ToDecStr<TChar>(UInt128 value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
src\libraries\System.Private.CoreLib\src\System\Number.Grisu3.cs (6)
429private static bool TryRunCounted(in DiyFp w, int requestedDigits, Span<byte> buffer, out int length, out int decimalExponent) 477private static bool TryRunShortest(in DiyFp boundaryMinus, in DiyFp w, in DiyFp boundaryPlus, Span<byte> buffer, out int length, out int decimalExponent) 580private static bool TryDigitGenCounted(in DiyFp w, int requestedDigits, Span<byte> buffer, out int length, out int kappa) 749private static bool TryDigitGenShortest(in DiyFp low, in DiyFp w, in DiyFp high, Span<byte> buffer, out int length, out int kappa) 914private static bool TryRoundWeedCounted(Span<byte> buffer, int length, ulong rest, ulong tenKappa, ulong unit, ref int kappa) 987private static bool TryRoundWeedShortest(Span<byte> buffer, int length, ulong distanceTooHighW, ulong unsafeInterval, ulong rest, ulong tenKappa, ulong unit)
src\libraries\System.Private.CoreLib\src\System\Numerics\IBinaryInteger.cs (6)
183/// <summary>Gets the number of bytes that will be written as part of <see cref="TryWriteLittleEndian(Span{byte}, out int)" />.</summary> 184/// <returns>The number of bytes that will be written as part of <see cref="TryWriteLittleEndian(Span{byte}, out int)" />.</returns> 195bool TryWriteBigEndian(Span<byte> destination, out int bytesWritten); 201bool TryWriteLittleEndian(Span<byte> destination, out int bytesWritten); 231int WriteBigEndian(Span<byte> destination) 268int WriteLittleEndian(Span<byte> destination)
src\libraries\System.Private.CoreLib\src\System\Numerics\IFloatingPoint.cs (12)
73/// <summary>Gets the number of bytes that will be written as part of <see cref="TryWriteExponentLittleEndian(Span{byte}, out int)" />.</summary> 74/// <returns>The number of bytes that will be written as part of <see cref="TryWriteExponentLittleEndian(Span{byte}, out int)" />.</returns> 85/// <summary>Gets the number of bytes that will be written as part of <see cref="TryWriteSignificandLittleEndian(Span{byte}, out int)" />.</summary> 86/// <returns>The number of bytes that will be written as part of <see cref="TryWriteSignificandLittleEndian(Span{byte}, out int)" />.</returns> 93bool TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten); 99bool TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten); 105bool TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten); 111bool TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten); 141int WriteExponentBigEndian(Span<byte> destination) 178int WriteExponentLittleEndian(Span<byte> destination) 215int WriteSignificandBigEndian(Span<byte> destination) 252int WriteSignificandLittleEndian(Span<byte> destination)
src\libraries\System.Private.CoreLib\src\System\Numerics\INumberBase.cs (1)
472bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Numerics\TotalOrderIeee754Comparer.cs (2)
158Span<byte> significandX = (uint)xSignificandLength <= StackAllocThreshold ? stackalloc byte[xSignificandLength] : new byte[xSignificandLength]; 159Span<byte> significandY = (uint)ySignificandLength <= StackAllocThreshold ? stackalloc byte[ySignificandLength] : new byte[ySignificandLength];
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector_1.cs (1)
128public Vector(Span<T> values) : this((ReadOnlySpan<T>)values)
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (4)
601/// <summary>Copies the vector to the given <see cref="Span{T}" />.The length of the destination span must be at least 2.</summary> 605public readonly void CopyTo(Span<float> destination) 615/// <summary>Attempts to copy the vector to the given <see cref="Span{Single}" />. The length of the destination span must be at least 2.</summary> 619public readonly bool TryCopyTo(Span<float> destination)
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (4)
608/// <summary>Copies the vector to the given <see cref="Span{T}" />. The length of the destination span must be at least 3.</summary> 612public readonly void CopyTo(Span<float> destination) 622/// <summary>Attempts to copy the vector to the given <see cref="Span{Single}" />. The length of the destination span must be at least 3.</summary> 626public readonly bool TryCopyTo(Span<float> destination)
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (4)
705/// <summary>Copies the vector to the given <see cref="Span{T}" />. The length of the destination span must be at least 4.</summary> 709public readonly void CopyTo(Span<float> destination) 719/// <summary>Attempts to copy the vector to the given <see cref="Span{Single}" />. The length of the destination span must be at least 4.</summary> 723public readonly bool TryCopyTo(Span<float> destination)
src\libraries\System.Private.CoreLib\src\System\OperatingSystem.cs (1)
108Span<char> stackBuffer = stackalloc char[128];
src\libraries\System.Private.CoreLib\src\System\Random.cs (5)
180public virtual void NextBytes(Span<byte> buffer) => _impl.NextBytes(buffer); 193public void GetItems<T>(ReadOnlySpan<T> choices, Span<T> destination) 208Span<byte> randomBytes = stackalloc byte[512]; // arbitrary size, a balance between stack consumed and number of random calls required 311public void Shuffle<T>(Span<T> values) 465public override void NextBytes(Span<byte> buffer) => LocalRandom.NextBytes(buffer);
src\libraries\System.Private.CoreLib\src\System\Random.ImplBase.cs (1)
34public abstract void NextBytes(Span<byte> buffer);
src\libraries\System.Private.CoreLib\src\System\Random.Net5CompatImpl.cs (3)
100public override void NextBytes(Span<byte> buffer) => _prng.NextBytes(buffer); 226public override void NextBytes(Span<byte> buffer) 315internal void NextBytes(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\Random.Xoshiro256StarStarImpl.cs (2)
134public override void NextBytes(byte[] buffer) => NextBytes((Span<byte>)buffer); 136public override unsafe void NextBytes(Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\Range.cs (1)
70Span<char> span = stackalloc char[2 + (2 * 11)]; // 2 for "..", then for each index 1 for '^' and 10 for longest possible uint
src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (1)
241Span<T> memoryManagerSpan = Unsafe.As<MemoryManager<T>>(tmpObject).GetSpan();
src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (2)
296public void CopyTo(Span<T> destination) 320public bool TryCopyTo(Span<T> destination)
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyNameHelpers.StrongName.cs (1)
22Span<byte> hash = stackalloc byte[20];
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (12)
202public object Invoke(Span<object?> arguments) 243internal object InvokeWithFewArgs(Span<object?> arguments) 248Span<object?> copyOfArgs = ((Span<object?>)stackArgStorage._args).Slice(0, _argCount); 249scoped Span<bool> shouldCopyBack = ((Span<bool>)stackArgStorage._shouldCopyBack).Slice(0, _argCount); 282return InvokeDirectByRefWithFewArgs(((Span<object?>)stackStorage._args).Slice(0, _argCount)); 285internal unsafe object InvokeDirectByRefWithFewArgs(Span<object?> copyOfArgs) 309internal unsafe object InvokeWithManyArgs(Span<object?> arguments) 311Span<object?> copyOfArgs; 395internal void CopyBack(Span<object?> dest, Span<object?> copyOfParameters, Span<bool> shouldCopyBack)
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (3)
16internal delegate object? InvokeFunc_ObjSpanArgs(object? obj, Span<object?> arguments); 94Type[] delegateParameters = new Type[2] { typeof(object), typeof(Span<object>) }; 330s_Span_get_Item ??= typeof(Span<object>).GetProperty("Item")!.GetGetMethod()!;
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Constructor.cs (1)
29Span<object?> copyOfArgs = new(ref Unsafe.AsRef<object?>(pStorage), argCount);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (15)
78Span<object?> copyOfArgs = new(ref copyOfArg); 81Span<bool> shouldCopyBack = new(ref copyBack); 121Span<object?> copyOfArgs = ((Span<object?>)stackArgStorage._args).Slice(0, _argCount); 122Span<bool> shouldCopyBack = ((Span<bool>)stackArgStorage._shouldCopyBack).Slice(0, _argCount); 153internal unsafe object? InvokeDirectByRefWithFewArgs(object? obj, Span<object?> copyOfArgs, BindingFlags invokeAttr) 195Span<object?> copyOfArgs; 198Span<bool> shouldCopyBack; 298Span<object?> copyOfArgs = new(ref copyOfArg, 1); 301Span<bool> shouldCopyBack = new(ref copyBack, 1); // Not used for setters 330internal void CopyBack(object?[] dest, Span<object?> copyOfParameters, Span<bool> shouldCopyBack) 353Span<object?> copyOfParameters, 354Span<bool> shouldCopyBack,
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (12)
239public object? Invoke(object? obj, Span<object?> arguments) 296internal object? InvokeWithFewArgs(object? obj, Span<object?> arguments) 301Span<object?> copyOfArgs = ((Span<object?>)stackArgStorage._args).Slice(0, _argCount); 302scoped Span<bool> shouldCopyBack = ((Span<bool>)stackArgStorage._shouldCopyBack).Slice(0, _argCount); 335return InvokeDirectByRefWithFewArgs(obj, ((Span<object?>)stackStorage._args).Slice(0, _argCount)); 338internal unsafe object? InvokeDirectByRefWithFewArgs(object? obj, Span<object?> copyOfArgs) 362internal unsafe object? InvokeWithManyArgs(object? obj, Span<object?> arguments) 364Span<object?> copyOfArgs; 448internal void CopyBack(Span<object?> dest, Span<object?> copyOfParameters, Span<bool> shouldCopyBack)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (1)
607Span<int> bits = stackalloc int[4];
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (2)
38private Span<char> _chars; 82public DefaultInterpolatedStringHandler(int literalLength, int formattedCount, IFormatProvider? provider, Span<char> initialBuffer)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (4)
16/// Get a <see cref="Span{T}"/> view over a <see cref="List{T}"/>'s data. 17/// Items should not be added or removed from the <see cref="List{T}"/> while the <see cref="Span{T}"/> is in use. 22public static Span<T> AsSpan<T>(List<T>? list) 24Span<T> span = default;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
53internal static unsafe void GetAnsiStringBytes(ReadOnlySpan<char> chars, Span<byte> bytes)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\AnsiStringMarshaller.cs (2)
28Span<byte> buffer = new(mem, exactByteCount); 67public void FromManaged(string? managed, Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (7)
59/// <returns>The <see cref="Span{TUnmanagedElement}"/> of unmanaged elements.</returns> 60public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 81/// <returns>The <see cref="Span{T}"/> of managed elements.</returns> 82public static Span<T> GetManagedValuesDestination(T[]? managed) 117private Span<TUnmanagedElement> _span; 128public void FromManaged(T[]? array, Span<TUnmanagedElement> buffer) 164public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
64public void FromManaged(string? managed, Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (1)
84public Span<T> AsSpan() => new(_data, _numElements);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (7)
60/// <returns>The <see cref="Span{TUnmanagedElement}"/> of unmanaged elements.</returns> 61public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 82/// <returns>The <see cref="Span{T}"/> of managed elements.</returns> 83public static Span<IntPtr> GetManagedValuesDestination(T*[]? managed) 118private Span<TUnmanagedElement> _span; 129public void FromManaged(T*[]? array, Span<TUnmanagedElement> buffer) 165public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (4)
70public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 87private Span<TUnmanagedElement> _span; 98public void FromManaged(ReadOnlySpan<T> managed, Span<TUnmanagedElement> buffer) 135public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (17)
12/// Supports marshalling a <see cref="Span{T}"/> from managed value 18/// A <see cref="Span{T}"/> marshalled with this marshaller will match the semantics of <see cref="MemoryMarshal.GetReference{T}(Span{T})"/>. 22[CustomMarshaller(typeof(Span<>), MarshalMode.Default, typeof(SpanMarshaller<,>))] 23[CustomMarshaller(typeof(Span<>), MarshalMode.ManagedToUnmanagedIn, typeof(SpanMarshaller<,>.ManagedToUnmanagedIn))] 34public static TUnmanagedElement* AllocateContainerForUnmanagedElements(Span<T> managed, out int numElements) 56public static ReadOnlySpan<T> GetManagedValuesSource(Span<T> managed) 65public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) 74public static Span<T> AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) 87public static Span<T> GetManagedValuesDestination(Span<T> managed) 114private Span<T> _managedArray; 116private Span<TUnmanagedElement> _span; 127public void FromManaged(Span<T> managed, Span<TUnmanagedElement> buffer) 163public Span<TUnmanagedElement> GetUnmanagedValuesDestination() => _span; 192public static ref T GetPinnableReference(Span<T> managed)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (2)
29Span<byte> buffer = new(mem, exactByteCount); 69public void FromManaged(string? managed, Span<byte> buffer)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (11)
16/// <see cref="Span{T}"/>, and <see cref="ReadOnlySpan{T}"/>. 32public static unsafe Span<byte> AsBytes<T>(Span<T> span) 82public static ref T GetReference<T>(Span<T> span) => ref span._reference; 95internal static unsafe ref T GetNonNullPinnableReference<T>(Span<T> span) => ref (span.Length != 0) ? ref Unsafe.AsRef(in span._reference) : ref Unsafe.AsRef<T>((void*)1); 116public static Span<TTo> Cast<TFrom, TTo>(Span<TFrom> span) 228public static Span<T> CreateSpan<T>(scoped ref T reference, int length) => 509public static unsafe void Write<T>(Span<byte> destination, in T value) 528public static unsafe bool TryWrite<T>(Span<byte> destination, in T value) 551public static unsafe ref T AsRef<T>(Span<byte> span)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (10)
872public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => _value.TryFormat(destination, out charsWritten, format, provider); 875public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => _value.TryFormat(utf8Destination, out bytesWritten, format, provider); 1052/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 1053bool IFloatingPoint<NFloat>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 1076/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 1077bool IFloatingPoint<NFloat>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 1100/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 1101bool IFloatingPoint<NFloat>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 1124/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 1125bool IFloatingPoint<NFloat>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ObjectiveC\ObjectiveCMarshal.PlatformNotSupported.cs (2)
80/// The memory it points at is defined by the length in the <see cref="Span{IntPtr}"/> and 93out Span<IntPtr> taggedMemory)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (1)
234public void ReadSpan<T>(ulong byteOffset, Span<T> buffer)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\ISimdVector_2.cs (2)
152static virtual void CopyTo(TSelf vector, Span<T> destination) 525static virtual bool TryCopyTo(TSelf vector, Span<T> destination)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\SimdVectorExtensions.cs (2)
47public static void CopyTo<TVector, T>(this TVector vector, Span<T> destination) 150public static bool TryCopyTo<TVector, T>(this TVector vector, Span<T> destination)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (2)
703public static void CopyTo<T>(this Vector128<T> vector, Span<T> destination) 2831public static bool TryCopyTo<T>(this Vector128<T> vector, Span<T> destination)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128_1.cs (4)
528/// <inheritdoc cref="ISimdVector{TSelf, T}.CopyTo(TSelf, Span{T})" /> 529static void ISimdVector<Vector128<T>, T>.CopyTo(Vector128<T> vector, Span<T> destination) => vector.CopyTo(destination); 682/// <inheritdoc cref="ISimdVector{TSelf, T}.TryCopyTo(TSelf, Span{T})" /> 683static bool ISimdVector<Vector128<T>, T>.TryCopyTo(Vector128<T> vector, Span<T> destination) => Vector128.TryCopyTo(vector, destination);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (2)
611public static void CopyTo<T>(this Vector256<T> vector, Span<T> destination) 2762public static bool TryCopyTo<T>(this Vector256<T> vector, Span<T> destination)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256_1.cs (4)
518/// <inheritdoc cref="ISimdVector{TSelf, T}.CopyTo(TSelf, Span{T})" /> 519static void ISimdVector<Vector256<T>, T>.CopyTo(Vector256<T> vector, Span<T> destination) => vector.CopyTo(destination); 672/// <inheritdoc cref="ISimdVector{TSelf, T}.TryCopyTo(TSelf, Span{T})" /> 673static bool ISimdVector<Vector256<T>, T>.TryCopyTo(Vector256<T> vector, Span<T> destination) => Vector256.TryCopyTo(vector, destination);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (2)
537public static void CopyTo<T>(this Vector512<T> vector, Span<T> destination) 2775public static bool TryCopyTo<T>(this Vector512<T> vector, Span<T> destination)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512_1.cs (4)
518/// <inheritdoc cref="ISimdVector{TSelf, T}.CopyTo(TSelf, Span{T})" /> 519static void ISimdVector<Vector512<T>, T>.CopyTo(Vector512<T> vector, Span<T> destination) => vector.CopyTo(destination); 672/// <inheritdoc cref="ISimdVector{TSelf, T}.TryCopyTo(TSelf, Span{T})" /> 673static bool ISimdVector<Vector512<T>, T>.TryCopyTo(Vector512<T> vector, Span<T> destination) => Vector512.TryCopyTo(vector, destination);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (2)
581public static void CopyTo<T>(this Vector64<T> vector, Span<T> destination) 2633public static bool TryCopyTo<T>(this Vector64<T> vector, Span<T> destination)
src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (1)
114Span<Range> components = stackalloc Range[4];
src\libraries\System.Private.CoreLib\src\System\SByte.cs (6)
121public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 127public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 426/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 427bool IBinaryInteger<sbyte>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 444/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 445bool IBinaryInteger<sbyte>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.cs (3)
135Span<char> copy = stackalloc char[4]; 168Span<char> newValues = stackalloc char[8]; 232Span<bool> seenValues = range <= 256 ? stackalloc bool[256] : new bool[range];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasick.cs (2)
267Span<char> destination = new char[2]; // Avoid stackalloc in a loop 335Span<char> destination = stackalloc char[2];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
172Span<char> upperCase = stackalloc char[MaxInputLength].Slice(0, span.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (1)
90Span<int> bucketIndexes = stackalloc int[RabinKarp.MaxValues].Slice(0, values.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (3)
58Span<string> normalizedValues = new string[uniqueValues.Count]; 98static Span<string> RemoveUnreachableValues(Span<string> values, HashSet<string> unreachableValues)
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (10)
43Span<char> span = AcquireSpan(ref bufferToRelease); 112Span<char> span = AcquireSpan(ref bufferToRelease); 139Span<char> span = AcquireSpan(ref bufferToRelease); 193Span<char> span = AcquireSpan(ref bufferToRelease); 238Span<char> span = AcquireSpan(ref bufferToRelease); 270Span<char> span = AcquireSpan(ref bufferToRelease); 281private unsafe Span<char> AcquireSpan(ref SafeBuffer? bufferToRelease) 319Span<char> span = AcquireSpan(ref bufferToRelease); 357Span<char> span = AcquireSpan(ref bufferToRelease).Slice(0, _decryptedLength); 379Span<char> resultSpan = new Span<char>((void*)ptr, byteLength / sizeof(char));
src\libraries\System.Private.CoreLib\src\System\Single.cs (10)
370public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 376public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 720/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentBigEndian(Span{byte}, out int)" /> 721bool IFloatingPoint<float>.TryWriteExponentBigEndian(Span<byte> destination, out int bytesWritten) 738/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteExponentLittleEndian(Span{byte}, out int)" /> 739bool IFloatingPoint<float>.TryWriteExponentLittleEndian(Span<byte> destination, out int bytesWritten) 756/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandBigEndian(Span{byte}, out int)" /> 757bool IFloatingPoint<float>.TryWriteSignificandBigEndian(Span<byte> destination, out int bytesWritten) 780/// <inheritdoc cref="IFloatingPoint{TSelf}.TryWriteSignificandLittleEndian(Span{byte}, out int)" /> 781bool IFloatingPoint<float>.TryWriteSignificandLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Span.cs (22)
120/// <summary>Creates a new <see cref="Span{T}"/> of length 1 around the specified reference.</summary> 171/// Gets a value indicating whether this <see cref="Span{T}"/> is empty. 184public static bool operator !=(Span<T> left, Span<T> right) => !(left == right); 209/// Defines an implicit conversion of an array to a <see cref="Span{T}"/> 211public static implicit operator Span<T>(T[]? array) => new Span<T>(array); 214/// Defines an implicit conversion of a <see cref="ArraySegment{T}"/> to a <see cref="Span{T}"/> 216public static implicit operator Span<T>(ArraySegment<T> segment) => 220/// Returns an empty <see cref="Span{T}"/> 222public static Span<T> Empty => default; 227/// <summary>Enumerates the elements of a <see cref="Span{T}"/>.</summary> 231private readonly Span<T> _span; 238internal Enumerator(Span<T> span) 314public void CopyTo(Span<T> destination) 338public bool TryCopyTo(Span<T> destination) 353public static bool operator ==(Span<T> left, Span<T> right) => 358/// Defines an implicit conversion of a <see cref="Span{T}"/> to a <see cref="ReadOnlySpan{T}"/> 360public static implicit operator ReadOnlySpan<T>(Span<T> span) => 364/// For <see cref="Span{Char}"/>, returns a new instance of string that represents the characters pointed to by the span. 384public Span<T> Slice(int start) 401public Span<T> Slice(int start, int length)
src\libraries\System.Private.CoreLib\src\System\SpanDebugView.cs (1)
12public SpanDebugView(Span<T> span)
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (1)
905Span<char> scratch = (uint)length < 64 ?
src\libraries\System.Private.CoreLib\src\System\String.cs (3)
356public static string Create(IFormatProvider? provider, Span<char> initialBuffer, [InterpolatedStringHandlerArgument(nameof(provider), nameof(initialBuffer))] ref DefaultInterpolatedStringHandler handler) => 432public void CopyTo(Span<char> destination) 448public bool TryCopyTo(Span<char> destination)
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (5)
281Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 298Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 320Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 345Span<char> resultSpan = new Span<char>(ref result._firstChar, result.Length); 1418Span<char> dstSpan = new Span<char>(ref dst._firstChar, dst.Length);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (18)
25/// <remarks>In-place conversion is prohibited, please use <see cref="ToUpperInPlace(Span{byte}, out int)"/> for that.</remarks> 27public static OperationStatus ToUpper(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 38/// <remarks>In-place conversion is prohibited, please use <see cref="ToUpperInPlace(Span{char}, out int)"/> for that.</remarks> 40public static OperationStatus ToUpper(ReadOnlySpan<char> source, Span<char> destination, out int charsWritten) 52public static OperationStatus ToUpper(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 64public static OperationStatus ToUpper(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 75/// <remarks>In-place conversion is prohibited, please use <see cref="ToLowerInPlace(Span{byte}, out int)"/> for that.</remarks> 77public static OperationStatus ToLower(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 88/// <remarks>In-place conversion is prohibited, please use <see cref="ToLowerInPlace(Span{char}, out int)"/> for that.</remarks> 90public static OperationStatus ToLower(ReadOnlySpan<char> source, Span<char> destination, out int charsWritten) 102public static OperationStatus ToLower(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 114public static OperationStatus ToLower(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten) 124public static OperationStatus ToLowerInPlace(Span<byte> value, out int bytesWritten) 134public static OperationStatus ToLowerInPlace(Span<char> value, out int charsWritten) 144public static OperationStatus ToUpperInPlace(Span<byte> value, out int bytesWritten) 154public static OperationStatus ToUpperInPlace(Span<char> value, out int charsWritten) 157private static unsafe OperationStatus ChangeCase<TFrom, TTo, TCasing>(ReadOnlySpan<TFrom> source, Span<TTo> destination, out int destinationElementsWritten) 192private static unsafe OperationStatus ChangeCase<T, TCasing>(Span<T> buffer, out int elementsWritten)
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Transcoding.cs (2)
20public static unsafe OperationStatus ToUtf16(ReadOnlySpan<byte> source, Span<char> destination, out int charsWritten) 55public static unsafe OperationStatus FromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (7)
314public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes) 326public override unsafe bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 381private protected sealed override unsafe int GetBytesWithFallback(ReadOnlySpan<char> chars, int originalCharsLength, Span<byte> bytes, int originalBytesLength, EncoderNLS? encoder, bool throwForDestinationOverflow = true) 605public override unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 617public override unsafe bool TryGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten) 670private protected sealed override unsafe int GetCharsWithFallback(ReadOnlySpan<byte> bytes, int originalBytesLength, Span<char> chars, int originalCharsLength, DecoderNLS? decoder, bool throwForDestinationOverflow = true) 778internal sealed override OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (2)
196public virtual unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars, bool flush) 302public virtual unsafe void Convert(ReadOnlySpan<byte> bytes, Span<char> chars, bool flush, out int bytesUsed, out int charsUsed, out bool completed)
src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (2)
215internal bool TryInternalFallbackGetChars(ReadOnlySpan<byte> remainingBytes, int fallbackLength, Span<char> chars, out int charsWritten) 267internal bool TryDrainRemainingDataForGetChars(Span<char> chars, out int charsWritten)
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (9)
61fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 106fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 107fixed (char* pChars = &MemoryMarshal.GetReference((Span<char>)chars)) 155fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 157fixed (char* pChars = &MemoryMarshal.GetReference((Span<char>)chars)) 233Span<byte> combinedBuffer = stackalloc byte[4]; 277internal int DrainLeftoverDataForGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int bytesConsumed) 289Span<byte> combinedBuffer = stackalloc byte[4]; 376private static int ConcatInto(ReadOnlySpan<byte> srcLeft, ReadOnlySpan<byte> srcRight, Span<byte> dest)
src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (2)
193public virtual unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, bool flush) 301public virtual unsafe void Convert(ReadOnlySpan<char> chars, Span<byte> bytes, bool flush, out int charsUsed, out int bytesUsed, out bool completed)
src\libraries\System.Private.CoreLib\src\System\Text\EncoderFallback.cs (2)
176internal bool TryInternalFallbackGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsConsumed, out int bytesWritten) 193internal bool TryDrainRemainingDataForGetBytes(Span<byte> bytes, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (6)
57fixed (char* pChars = &MemoryMarshal.GetReference((Span<char>)chars)) 96fixed (char* pChars = &MemoryMarshal.GetReference((Span<char>)chars)) 97fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 142fixed (char* pChars = &MemoryMarshal.GetReference((Span<char>)chars)) 144fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 313internal bool TryDrainLeftoverDataForGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsConsumed, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (4)
727public virtual unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes) 741public virtual bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 876public virtual unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 890public virtual bool TryGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten)
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (6)
79internal virtual OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten) 512/// after data has been drained, then to call <see cref="GetBytesWithFallback(ReadOnlySpan{char}, int, Span{byte}, int, EncoderNLS, bool)"/>. 532Span<byte> bytes = new Span<byte>(pOriginalBytes, originalByteCount).Slice(bytesWrittenSoFar); 586private protected virtual unsafe int GetBytesWithFallback(ReadOnlySpan<char> chars, int originalCharsLength, Span<byte> bytes, int originalBytesLength, EncoderNLS? encoder, bool throwForDestinationOverflow = true) 1134Span<char> chars = new Span<char>(pOriginalChars, originalCharCount).Slice(charsWrittenSoFar); 1187private protected virtual unsafe int GetCharsWithFallback(ReadOnlySpan<byte> bytes, int originalBytesLength, Span<char> chars, int originalCharsLength, DecoderNLS? decoder, bool throwForDestinationOverflow = true)
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (5)
226public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes) 238public override unsafe bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 521public override unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 533public override unsafe bool TryGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten) 659internal sealed override OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (10)
213Span<char> original = stackalloc char[MaxUtf16CharsPerRune]; 214Span<char> modified = stackalloc char[MaxUtf16CharsPerRune]; 735public int EncodeToUtf16(Span<char> destination) 753public int EncodeToUtf8(Span<byte> destination) 916bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 919bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 1009public bool TryEncodeToUtf16(Span<char> destination, out int charsWritten) 1016private static bool TryEncodeToUtf16(Rune value, Span<char> destination, out int charsWritten) 1053public bool TryEncodeToUtf8(Span<byte> destination, out int bytesWritten) 1060private static bool TryEncodeToUtf8(Rune value, Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (6)
883public void CopyTo(int sourceIndex, Span<char> destination, int count) 1415Span<char> buffer = stackalloc char[string.StackallocCharBufferSizeLimit]; 2233Span<char> span = chunk.m_ChunkChars.AsSpan(curInChunk, endInChunk - curInChunk); 2519private Span<char> RemainingCurrentChunk 2895Span<char> destination = _stringBuilder.RemainingCurrentChunk; 2959Span<char> destination = _stringBuilder.RemainingCurrentChunk;
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
296public override int Read(Span<byte> buffer) 508Span<char> decodedChars = scratchChars.AsSpan(0, charsWritten);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (13)
47public static unsafe OperationStatus FromUtf16(ReadOnlySpan<char> source, Span<byte> destination, out int charsRead, out int bytesWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) 133public static unsafe OperationStatus ToUtf16(ReadOnlySpan<byte> source, Span<char> destination, out int bytesRead, out int charsWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) 219internal static unsafe OperationStatus ToUtf16PreservingReplacement(ReadOnlySpan<byte> source, Span<char> destination, out int bytesRead, out int charsWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) 323public static bool TryWrite(Span<byte> destination, [InterpolatedStringHandlerArgument(nameof(destination))] ref TryWriteInterpolatedStringHandler handler, out int bytesWritten) 343public static bool TryWrite(Span<byte> destination, IFormatProvider? provider, [InterpolatedStringHandlerArgument(nameof(destination), nameof(provider))] ref TryWriteInterpolatedStringHandler handler, out int bytesWritten) => 354private readonly Span<byte> _destination; 364/// <summary>Creates a handler used to write an interpolated string into a UTF-8 <see cref="Span{Byte}"/>.</summary> 370public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, Span<byte> destination, out bool shouldAppend) 379/// <summary>Creates a handler used to write an interpolated string into a UTF-8 <see cref="Span{Byte}"/>.</summary> 386public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, Span<byte> destination, IFormatProvider? provider, out bool shouldAppend) 403Span<byte> dest = _destination.Slice(_pos); 677Span<char> utf16 = stackalloc char[256]; 724Span<char> utf16 = stackalloc char[256];
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (3)
157fixed (char* pChars = s) fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 197fixed (char* pChars = chars) fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 286fixed (byte* pBytes = bytes) fixed (char* pChars = &MemoryMarshal.GetReference((Span<char>)chars))
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (3)
165fixed (char* pChars = s) fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 205fixed (char* pChars = chars) fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 294fixed (byte* pBytes = bytes) fixed (char* pChars = &MemoryMarshal.GetReference((Span<char>)chars))
src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (3)
201fixed (char* pChars = s) fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 241fixed (char* pChars = chars) fixed (byte* pBytes = &MemoryMarshal.GetReference((Span<byte>)bytes)) 330fixed (byte* pBytes = bytes) fixed (char* pChars = &MemoryMarshal.GetReference((Span<char>)chars))
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (6)
361public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes) 373public override unsafe bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten) 556public override unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars) 568public override unsafe bool TryGetChars(ReadOnlySpan<byte> bytes, Span<char> chars, out int charsWritten) 634private protected sealed override unsafe int GetCharsWithFallback(ReadOnlySpan<byte> bytes, int originalBytesLength, Span<char> chars, int originalCharsLength, DecoderNLS? decoder, bool throwForDestinationOverflow = true) 777internal sealed override OperationStatus EncodeRune(Rune value, Span<byte> bytes, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (1)
153public override bool TryGetBytes(ReadOnlySpan<char> chars, Span<byte> bytes, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (1)
3486Span<object?> continuations = CollectionsMarshal.AsSpan(list);
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (5)
239Span<SafeWaitHandle?> safeWaitHandles, 240Span<IntPtr> unsafeWaitHandles) 330Span<IntPtr> unsafeWaitHandles = stackalloc IntPtr[waitHandles.Length]; 392Span<IntPtr> unsafeWaitHandles = stackalloc IntPtr[safeWaitHandles.Length]; 404internal static int WaitMultipleIgnoringSyncContext(Span<IntPtr> handles, bool waitAll, int millisecondsTimeout)
src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (3)
961public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 965public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 968private bool TryFormatCore<TChar>(Span<TChar> destination, out int written, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] ReadOnlySpan<char> format, IFormatProvider? provider) where TChar : unmanaged, IUtfChar<TChar>
src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (2)
725public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null) 729public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null)
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (2)
119public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 125public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null)
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (6)
113public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 119public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 397/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 398bool IBinaryInteger<ushort>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 415/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 416bool IBinaryInteger<ushort>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (6)
123public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 129public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 429/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 430bool IBinaryInteger<uint>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 447/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 448bool IBinaryInteger<uint>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (6)
122public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 128public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 428/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 429bool IBinaryInteger<ulong>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 446/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 447bool IBinaryInteger<ulong>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (6)
207public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 211public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 438/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 439bool IBinaryInteger<nuint>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 461/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 462bool IBinaryInteger<nuint>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
src\libraries\System.Private.CoreLib\src\System\Version.cs (8)
173Span<char> dest = stackalloc char[(4 * Number.Int32NumberBufferLength) + 3]; // at most 4 Int32s and 3 periods 182public bool TryFormat(Span<char> destination, out int charsWritten) => 185public bool TryFormat(Span<char> destination, int fieldCount, out int charsWritten) => 192public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten) => 200public bool TryFormat(Span<byte> utf8Destination, int fieldCount, out int bytesWritten) => 203private bool TryFormatCore<TChar>(Span<TChar> destination, int fieldCount, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 269bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 274bool IUtf8SpanFormattable.TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider) =>
src\System\Collections\Generic\ArraySortHelper.CoreCLR.cs (3)
11void Sort(Span<TKey> keys, IComparer<TKey>? comparer); 45void Sort(Span<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer);
src\System\Reflection\RuntimeAssembly.cs (1)
50public override int Read(Span<byte> buffer) => ReadCore(buffer);
src\System\RuntimeHandles.cs (2)
163internal static ReadOnlySpan<IntPtr> CopyRuntimeTypeHandles(RuntimeTypeHandle[]? inHandles, Span<IntPtr> stackScratch) 170Span<IntPtr> outHandles = inHandles.Length <= stackScratch.Length ?
src\System\RuntimeType.CoreCLR.cs (1)
1283Span<bool> usedSlots,
src\System\StubHelpers.cs (1)
444Span<char> native = new Span<char>((char*)nativeHome, length);
src\System\Threading\WaitHandle.CoreCLR.cs (1)
14private static unsafe int WaitMultipleIgnoringSyncContextCore(Span<IntPtr> waitHandles, bool waitAll, int millisecondsTimeout)
System.Private.CoreLib.Generators (8)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T> initialSpan) 49Span<T> span = _span; 65Span<T> span = _span; 104public Span<T> AppendSpan(int length) 109Span<T> span = _span; 122private Span<T> AppendSpanWithGrow(int length) 146public bool TryCopyTo(Span<T> destination, out int itemsWritten)
System.Private.DataContractSerialization (24)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
System\Runtime\Serialization\DataContract.cs (1)
1659Span<char> formatted = stackalloc char[Globals.SerializationNamespace.Length];
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (1)
174public override int Read(Span<byte> buffer)
System\Runtime\Serialization\MemoryStreamAdapter.cs (1)
63Span<byte> slicedBuffer = value.Buffer.AsSpan(value.Origin, value.Length - value.Origin);
System\Xml\EncodingStreamWrapper.cs (1)
587public override int Read(Span<byte> buffer)
System\Xml\UniqueId.cs (1)
215private unsafe void ToSpan(Span<char> chars)
System\Xml\XmlBinaryWriter.cs (10)
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)); 777Span<int> bits = stackalloc int[4]; 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)); 957Span<int> bits = stackalloc int[4]; 964Span<byte> span = GetBuffer(16, out int bufferOffset).AsSpan(bufferOffset, 16); 995Span<byte> bytes = GetBuffer(16, out int bufferOffset).AsSpan(bufferOffset, 16);
System\Xml\XmlBufferReader.cs (2)
485public void ReadRawArrayBytes<T>(Span<T> dst) 491public void ReadRawArrayBytes(Span<byte> dst)
System\Xml\XmlConverter.cs (1)
1096public static int StripWhitespace(Span<char> chars)
System\Xml\XmlStreamNodeWriter.cs (1)
232var buffer = GetBuffer(bytes.Length, out int offset).AsSpan(offset, bytes.Length);
System.Private.Uri (30)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (1)
21Span<byte> numbers = stackalloc byte[NumberOfLabels];
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
287internal static void Parse(ReadOnlySpan<char> address, Span<ushort> numbers, int start, ref string? scopeId)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
System\IPv4AddressHelper.cs (1)
21Span<char> stackSpace = stackalloc char[NumberOfLabels * 3 + 3];
System\IPv6AddressHelper.cs (2)
14Span<ushort> numbers = stackalloc ushort[NumberOfLabels]; 25Span<char> stackSpace = stackalloc char[48]; // large enough for any IPv6 string, including brackets
System\IriHelper.cs (2)
96Span<byte> maxUtf8EncodedSpan = stackalloc byte[4]; 183Span<byte> encodedBytes = maxUtf8EncodedSpan.Slice(0, bytesWritten);
System\Uri.cs (5)
1042Span<char> slashSpan = result.AsSpan(0, count); 1381return string.Create(3, (byte)character, (Span<char> chars, byte b) => 1572public bool TryFormat(Span<char> destination, out int charsWritten) 1640bool ISpanFormattable.TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) => 4549private static int Compress(Span<char> span, UriParser syntax)
System\UriExt.cs (2)
607public static bool TryUnescapeDataString(ReadOnlySpan<char> charsToUnescape, Span<char> destination, out int charsWritten) 701public static bool TryEscapeDataString(ReadOnlySpan<char> charsToEscape, Span<char> destination, out int charsWritten) =>
System\UriHelper.cs (2)
121public static bool TryEscapeDataString(ReadOnlySpan<char> charsToEscape, Span<char> destination, out int charsWritten) 243Span<byte> utf8Bytes = stackalloc byte[4];
System\ValueStringBuilderExtensions.cs (1)
14Span<char> chars = _chars;
System.Private.Xml (59)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
System\Xml\Base64Decoder.cs (1)
102private void Decode(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsDecoded, out int bytesDecoded)
System\Xml\BinaryXml\SqlUtils.cs (3)
192Span<char> pszTmp = stackalloc char[s_NUMERIC_MAX_PRECISION + 1]; //Local Character buffer to hold 226Span<char> szResult = stackalloc char[uiResultLen]; 390Span<char> chars = stackalloc char[fractionDigits];
System\Xml\BinaryXml\XmlBinaryReader.cs (1)
2335Span<byte> dstBytes = MemoryMarshal.AsBytes(dstChars);
System\Xml\BinHexDecoder.cs (1)
137Span<byte> bytes,
System\Xml\Cache\XPathDocumentNavigator.cs (1)
898Span<char> buf = stackalloc char[1 + 7 + 1 + 7];
System\Xml\Schema\XsdDateTime.cs (7)
499Span<char> destination = stackalloc char[CharStackBufferSize]; 506public bool TryFormat(Span<char> destination, out int charsWritten) 556Span<char> text = vsb.AppendSpan(s_lzyyyy_MM_dd); 622Span<char> text = vsb.AppendSpan(s_lzHH_mm_ss); 647Span<char> text; 675private static void WriteXDigits(Span<char> text, int start, int value, int digits) 685private static void Write2Digits(Span<char> text, int start, int value)
System\Xml\Schema\XsdDuration.cs (3)
345Span<char> destination = stackalloc char[CharStackBufferSize]; 352public bool TryFormat(Span<char> destination, out int charsWritten, DurationType durationType = DurationType.Duration) 409Span<char> tmpSpan = stackalloc char[9];
System\Xml\Serialization\CodeGenerator.cs (1)
438_ilGen!.Emit(OpCodes.Newobj, typeof(Span<>).MakeGenericType(elementType).GetConstructor(new Type[] { typeof(void*), typeof(int) })!);
System\Xml\Serialization\Xmlcustomformatter.cs (1)
108internal static bool TryFormatDateTime(DateTime value, Span<char> destination, out int charsWritten)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (4)
3448LocalBuilder paramsRead = ilg.DeclareLocal(typeof(Span<bool>), "paramsRead"); 3456ilg.New(typeof(Span<bool>).GetConstructor(new[] { typeof(bool[]) })!); 3611ilg.Call(typeof(Span<bool>).GetMethod("get_Item")!); 3624ilg.Call(typeof(Span<bool>).GetMethod("get_Item")!);
System\Xml\Serialization\XmlSerializationWriter.cs (1)
126internal static bool TryFormatDateTime(DateTime value, Span<char> destination, out int charsWritten)
System\Xml\XmlConvert.cs (20)
1639internal static bool TryFormat(bool value, Span<char> destination, out int charsWritten) 1647internal static bool TryFormat(char value, Span<char> destination, out int charsWritten) 1656internal static bool TryFormat(decimal value, Span<char> destination, out int charsWritten) 1661internal static bool TryFormat(sbyte value, Span<char> destination, out int charsWritten) 1666internal static bool TryFormat(short value, Span<char> destination, out int charsWritten) 1671internal static bool TryFormat(int value, Span<char> destination, out int charsWritten) 1676internal static bool TryFormat(long value, Span<char> destination, out int charsWritten) 1681internal static bool TryFormat(byte value, Span<char> destination, out int charsWritten) 1686internal static bool TryFormat(ushort value, Span<char> destination, out int charsWritten) 1691internal static bool TryFormat(uint value, Span<char> destination, out int charsWritten) 1696internal static bool TryFormat(ulong value, Span<char> destination, out int charsWritten) 1701internal static bool TryFormat(float value, Span<char> destination, out int charsWritten) 1725internal static bool TryFormat(double value, Span<char> destination, out int charsWritten) 1749internal static bool TryFormat(TimeSpan value, Span<char> destination, out int charsWritten) 1754internal static bool TryFormat(DateTime value, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format, Span<char> destination, out int charsWritten) 1759internal static bool TryFormat(DateTime value, Span<char> destination, out int charsWritten) 1764internal static bool TryFormat(DateTime value, XmlDateTimeSerializationMode dateTimeOption, Span<char> destination, out int charsWritten) 1791internal static bool TryFormat(DateTimeOffset value, Span<char> destination, out int charsWritten) 1797internal static bool TryFormat(DateTimeOffset value, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] string format, Span<char> destination, out int charsWritten) 1802internal static bool TryFormat(Guid value, Span<char> destination, out int charsWritten)
System\Xml\Xsl\Runtime\NumberFormatter.cs (1)
84Span<char> letters = stackalloc char[MaxAlphabeticLength];
System\Xml\Xsl\Xslt\XsltLoader.cs (1)
956Span<char> characters = stackalloc char[NumCharAttrs];
System.Reflection.Metadata (21)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (2)
251Span<Range> parts = stackalloc Range[5]; 261Span<ushort> versionNumbers = stackalloc ushort[4] { ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue };
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
System\Reflection\Internal\Utilities\DecimalUtilities.cs (2)
11Span<int> bits = stackalloc int[4]; 22Span<int> bits = stackalloc int[4];
System\Reflection\Internal\Utilities\ImmutableMemoryStream.cs (1)
78public override int Read(Span<byte> buffer)
System\Reflection\Internal\Utilities\ReadOnlyUnmanagedMemoryStream.cs (1)
42public override int Read(Span<byte> buffer)
System\Reflection\Internal\Utilities\StreamExtensions.cs (1)
80internal static int TryReadAll(this Stream stream, Span<byte> buffer)
System\Reflection\Metadata\BlobBuilder.cs (1)
53private Span<byte> Span => _buffer.AsSpan(0, Length);
System.Resources.Extensions (1)
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
26fixed (byte* ptr = &MemoryMarshal.GetReference((Span<byte>)array))
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net9.0\System.Runtime.Forwards.cs (1)
739[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Span<>))]
System.Runtime.InteropServices.JavaScript (7)
artifacts\obj\System.Runtime.InteropServices.JavaScript\Debug\net9.0\System.Runtime.InteropServices.JavaScript.notsupported.cs (7)
156public static void InvokeJS(JSFunctionBinding signature, Span<JSMarshalerArgument> arguments) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 300public void ToManaged(out Span<byte> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 301public void ToJS(Span<byte> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 304public void ToManaged(out Span<int> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 305public void ToJS(Span<int> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 306public void ToManaged(out Span<double> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); } 307public void ToJS(Span<double> value) { throw new System.PlatformNotSupportedException(System.SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported); }
System.Runtime.Numerics (232)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
467Span<int> thousandsSepPos = stackalloc int[4];
src\libraries\Common\src\System\Number.NumberBuffer.cs (2)
34public readonly Span<byte> Digits => new Span<byte>(DigitsPtr, DigitsLength); 44public NumberBuffer(NumberBufferKind kind, Span<byte> digits)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T> initialSpan) 49Span<T> span = _span; 65Span<T> span = _span; 104public Span<T> AppendSpan(int length) 109Span<T> span = _span; 122private Span<T> AppendSpanWithGrow(int length) 146public bool TryCopyTo(Span<T> destination, out int itemsWritten)
System\Number.BigInteger.cs (27)
244Span<uint> wholeBlockDestination = bits.AsSpan(0, wholeBlockCount); 348Span<uint> stackBuffer = stackalloc uint[BigIntegerCalculator.StackAllocThreshold]; 349Span<uint> currentBuffer = stackBuffer; 367bool ProcessChunk(ReadOnlySpan<byte> chunkDigits, ref Span<uint> currentBuffer) 429Span<uint> currentBuffer; 436Span<uint> buffer = new uint[bufferSize]; 438Span<uint> newBuffer = MemoryMarshal.Cast<int, uint>(arrayFromPoolForResultBuffer).Slice(0, bufferSize); 490Span<uint> multiplier = MemoryMarshal.Cast<int, uint>(arrayFromPoolForMultiplier).Slice(0, blockSize); 503Span<uint> curBuffer = buffer.Slice(i); 504Span<uint> curNewBuffer = newBuffer.Slice(i); 539Span<uint> tmp = buffer; 552Span<uint> newMultiplier = MemoryMarshal.Cast<int, uint>(arrayFromPoolForMultiplier).Slice(0, blockSize); 586BigInteger NumberBufferToBigInteger(Span<uint> currentBuffer, bool signa) 624void MultiplyAdd(ref Span<uint> currentBuffer, uint multiplier, uint addValue) 626Span<uint> curBits = currentBuffer.Slice(0, currentBufferSize); 646Span<uint> newBuffer = MemoryMarshal.Cast<int, uint>(arrayFromPoolForResultBuffer); 661private static string? FormatBigIntegerToHex(bool targetSpan, BigInteger value, char format, int digits, NumberFormatInfo info, Span<char> destination, out int charsWritten, out bool spanSuccess) 667Span<byte> bits = stackalloc byte[64]; // arbitrary threshold 706Span<char> chars = sb.AppendSpan((cur + 1) * 2); 744private static string? FormatBigIntegerToBinary(bool targetSpan, BigInteger value, int digits, Span<char> destination, out int charsWritten, out bool spanSuccess) 748Span<byte> bytes = stackalloc byte[64]; // arbitrary threshold 848internal static bool TryFormatBigInteger(BigInteger value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<char> destination, out int charsWritten) 860NumberFormatInfo info, Span<char> destination, out int charsWritten, out bool spanSuccess) 904Span<uint> base1E9Buffer = cuMax < BigIntegerCalculator.StackAllocThreshold ? 982Span<byte> numberBuffer = valueDigits + 1 <= CharStackBufferSize ? 1076static virtual bool TryParseWholeBlocks(ReadOnlySpan<TChar> input, Span<uint> destination) 1106public static bool TryParseWholeBlocks(ReadOnlySpan<TChar> input, Span<uint> destination)
System\Numerics\BigInteger.cs (59)
218Span<int> bits = stackalloc int[4]; 366Span<byte> uintBytes = MemoryMarshal.AsBytes(val.AsSpan(0, wholeUInt32Count)); 528private BigInteger(Span<uint> value) 767Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 797Span<uint> rest = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 803Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 920Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 933Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 988Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1048Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1059Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1264public bool TryWriteBytes(Span<byte> destination, out int bytesWritten, bool isUnsigned = false, bool isBigEndian = false) 1275internal bool TryWriteOrCountBytes(Span<byte> destination, out int bytesWritten, bool isUnsigned = false, bool isBigEndian = false) 1281/// <summary>Gets the number of bytes that will be output by <see cref="ToByteArray(bool, bool)"/> and <see cref="TryWriteBytes(Span{byte}, out int, bool, bool)"/>.</summary> 1288TryGetBytes(GetBytesMode.Count, default(Span<byte>), isUnsigned, IsBigEndian, ref count); 1292/// <summary>Mode used to enable sharing <see cref="TryGetBytes(GetBytesMode, Span{byte}, bool, bool, ref int)"/> for multiple purposes.</summary> 1300/// <summary>Shared logic for <see cref="ToByteArray(bool, bool)"/>, <see cref="TryWriteBytes(Span{byte}, out int, bool, bool)"/>, and <see cref="GetByteCount"/>.</summary> 1316private byte[]? TryGetBytes(GetBytesMode mode, Span<byte> destination, bool isUnsigned, bool isBigEndian, ref int bytesWritten) 1505private int WriteTo(Span<uint> buffer) 1629public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) 1649Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1661Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1673Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1685Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1727Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1739Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1749Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1761Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 2338Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2345Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2352Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2394Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2401Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2408Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2445Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2452Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2459Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2499Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 2506Span<uint> zd = ((uint)zl <= BigIntegerCalculator.StackAllocThreshold 2560Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 2588Span<uint> zd = ((uint)zl <= BigIntegerCalculator.StackAllocThreshold 2702Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2714Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2724Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2736Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2749Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2791Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2817Span<uint> quotient = ((uint)size < BigIntegerCalculator.StackAllocThreshold 2867Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 3101private bool GetPartsForBitManipulation(Span<uint> xd) 3251Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold) 3261Span<uint> zd = (zl <= BigIntegerCalculator.StackAllocThreshold) 3386Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold) 3396Span<uint> zd = (zl <= BigIntegerCalculator.StackAllocThreshold) 3591/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteBigEndian(Span{byte}, out int)" /> 3592bool IBinaryInteger<BigInteger>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 3693/// <inheritdoc cref="IBinaryInteger{TSelf}.TryWriteLittleEndian(Span{byte}, out int)" /> 3694bool IBinaryInteger<BigInteger>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten) 5231Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold
System\Numerics\BigIntegerCalculator.AddSub.cs (9)
14private static void CopyTail(ReadOnlySpan<uint> source, Span<uint> dest, int start) 19public static void Add(ReadOnlySpan<uint> left, uint right, Span<uint> bits) 27public static void Add(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits) 59private static void AddSelf(Span<uint> left, ReadOnlySpan<uint> right) 90public static void Subtract(ReadOnlySpan<uint> left, uint right, Span<uint> bits) 99public static void Subtract(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits) 132private static void SubtractSelf(Span<uint> left, ReadOnlySpan<uint> right) 167private static void Add(ReadOnlySpan<uint> left, Span<uint> bits, ref uint resultPtr, int startIndex, long initialCarry) 214private static void Subtract(ReadOnlySpan<uint> left, Span<uint> bits, ref uint resultPtr, int startIndex, long initialCarry)
System\Numerics\BigIntegerCalculator.DivRem.cs (11)
11public static void Divide(ReadOnlySpan<uint> left, uint right, Span<uint> quotient, out uint remainder) 32public static void Divide(ReadOnlySpan<uint> left, uint right, Span<uint> quotient) 64public static void Divide(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> quotient, Span<uint> remainder) 76public static void Divide(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> quotient) 89Span<uint> leftCopy = (left.Length <= StackAllocThreshold ? 100public static void Remainder(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> remainder) 113private static void Divide(Span<uint> left, ReadOnlySpan<uint> right, Span<uint> bits) 196private static uint AddDivisor(Span<uint> left, ReadOnlySpan<uint> right) 215private static uint SubtractDivisor(Span<uint> left, ReadOnlySpan<uint> right, ulong q)
System\Numerics\BigIntegerCalculator.FastReducer.cs (9)
20private readonly Span<uint> _q1; 21private readonly Span<uint> _q2; 23public FastReducer(ReadOnlySpan<uint> modulus, Span<uint> r, Span<uint> mu, Span<uint> q1, Span<uint> q2) 44public int Reduce(Span<uint> value) 68private static int DivMul(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits, int k) 102private static int SubMod(Span<uint> left, ReadOnlySpan<uint> right, ReadOnlySpan<uint> modulus, int k)
System\Numerics\BigIntegerCalculator.GcdInv.cs (11)
57public static void Gcd(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> result) 67Span<uint> rightCopy = (right.Length <= StackAllocThreshold ? 78private static void Gcd(Span<uint> left, Span<uint> right) 84Span<uint> result = left; //keep result buffer untouched during computation 161Span<uint> temp = left; 175Span<uint> temp = left; 203private static int Overwrite(Span<uint> buffer, ulong value) 275private static int LehmerCore(Span<uint> x, 276Span<uint> y, 304private static int Refresh(Span<uint> bits, int maxLength)
System\Numerics\BigIntegerCalculator.PowMod.cs (57)
16public static void Pow(uint value, uint power, Span<uint> bits) 21public static void Pow(ReadOnlySpan<uint> value, uint power, Span<uint> bits) 26Span<uint> temp = (bits.Length <= StackAllocThreshold ? 32Span<uint> valueCopy = (bits.Length <= StackAllocThreshold ? 38Span<uint> result = PowCore(valueCopy, value.Length, temp, power, bits); 48private static Span<uint> PowCore(Span<uint> value, int valueLength, Span<uint> temp, uint power, Span<uint> result) 70private static int MultiplySelf(ref Span<uint> left, int leftLength, ReadOnlySpan<uint> right, ref Span<uint> temp) 87Span<uint> t = left; 93private static int SquareSelf(ref Span<uint> value, int valueLength, ref Span<uint> temp) 104Span<uint> t = value; 203ReadOnlySpan<uint> modulus, Span<uint> bits) 209ReadOnlySpan<uint> modulus, Span<uint> bits) 219Span<uint> valueCopy = (size <= StackAllocThreshold ? 238Span<uint> temp = (bits.Length <= StackAllocThreshold ? 252ReadOnlySpan<uint> modulus, Span<uint> bits) 258ReadOnlySpan<uint> modulus, Span<uint> bits) 268Span<uint> valueCopy = (size <= StackAllocThreshold ? 287Span<uint> temp = (bits.Length <= StackAllocThreshold ? 308private static void PowCore(Span<uint> value, int valueLength, 310Span<uint> temp, Span<uint> bits) 318Span<uint> result = PowCore(value, valueLength, power, modulus, bits, 1, temp); 326Span<uint> r = ((uint)size <= StackAllocThreshold ? 333Span<uint> mu = ((uint)size <= StackAllocThreshold ? 340Span<uint> q1 = ((uint)size <= StackAllocThreshold ? 346Span<uint> q2 = ((uint)size <= StackAllocThreshold ? 356Span<uint> result = PowCore(value, valueLength, power, reducer, bits, 1, temp); 369private static void PowCore(Span<uint> value, int valueLength, 371Span<uint> temp, Span<uint> bits) 378Span<uint> result = PowCore(value, valueLength, power, modulus, bits, 1, temp); 386Span<uint> r = ((uint)size <= StackAllocThreshold ? 393Span<uint> mu = ((uint)size <= StackAllocThreshold ? 400Span<uint> q1 = ((uint)size <= StackAllocThreshold ? 406Span<uint> q2 = ((uint)size <= StackAllocThreshold ? 416Span<uint> result = PowCore(value, valueLength, power, reducer, bits, 1, temp); 429private static Span<uint> PowCore(Span<uint> value, int valueLength, 431Span<uint> result, int resultLength, 432Span<uint> temp) 459private static Span<uint> PowCore(Span<uint> value, int valueLength, 461Span<uint> result, int resultLength, 462Span<uint> temp) 488private static Span<uint> PowCore(Span<uint> value, int valueLength, 490Span<uint> result, int resultLength, 491Span<uint> temp) 518private static Span<uint> PowCore(Span<uint> value, int valueLength, 520Span<uint> result, int resultLength, 521Span<uint> temp)
System\Numerics\BigIntegerCalculator.SquMul.cs (19)
21public static void Square(ReadOnlySpan<uint> value, Span<uint> bits) 89Span<uint> bitsLow = bits.Slice(0, n2); 90Span<uint> bitsHigh = bits.Slice(n2); 100Span<uint> fold = ((uint)foldLength <= StackAllocThreshold ? 107Span<uint> core = ((uint)coreLength <= StackAllocThreshold ? 131public static void Multiply(ReadOnlySpan<uint> left, uint right, Span<uint> bits) 159public static void Multiply(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits) 217Span<uint> bitsLow = bits.Slice(0, n + right.Length); 218Span<uint> bitsHigh = bits.Slice(n); 225Span<uint> carry = ((uint)carryLength <= StackAllocThreshold ? 229Span<uint> carryOrig = bits.Slice(n, right.Length); 247static void MultiplyKaratsuba(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits, int n) 269Span<uint> bitsLow = bits.Slice(0, n + n); 270Span<uint> bitsHigh = bits.Slice(n + n); 284Span<uint> leftFold = ((uint)foldLength <= StackAllocThreshold ? 290Span<uint> rightFold = ((uint)foldLength <= StackAllocThreshold ? 303Span<uint> core = ((uint)coreLength <= StackAllocThreshold ? 331static void Naive(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits) 362private static void SubtractCore(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> core)
System\Numerics\BigIntegerCalculator.Utils.cs (1)
46private static int Reduce(Span<uint> bits, ReadOnlySpan<uint> modulus)
System\Numerics\Complex.cs (4)
2211/// <inheritdoc cref="ISpanFormattable.TryFormat(Span{char}, out int, ReadOnlySpan{char}, IFormatProvider?)" /> 2212public bool TryFormat(Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 2215public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = null) => 2218private bool TryFormatCore<TChar>(Span<TChar> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider) where TChar : unmanaged, IBinaryInteger<TChar>
System\Numerics\NumericsHelpers.cs (1)
100public static void DangerousMakeTwosComplement(Span<uint> d)
System.Security.Cryptography (687)
Microsoft\Win32\SafeHandles\SafePasswordHandle.cs (1)
52Span<char> dest = new Span<char>((void*)handle, spanLen);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
38Span<byte> spanBuffer = stackalloc byte[StackBufferSize];
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs (3)
25internal static unsafe int BioGets(SafeBioHandle b, Span<byte> buf) 37private static partial int BioRead(SafeBioHandle b, Span<byte> data, int len); 38internal static int BioRead(SafeBioHandle b, Span<byte> data) => BioRead(b, data, data.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Dsa.cs (1)
65internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan<byte> hash, Span<byte> refSignature, out int outSignatureLength) =>
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EcDsa.cs (1)
12internal static bool EcDsaSign(ReadOnlySpan<byte> dgst, Span<byte> sig, out int siglen, SafeEcKeyHandle ecKey) =>
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.Cipher.cs (5)
105Span<byte> output, 139Span<byte> output, 152internal static void EvpCipherGetGcmTag(SafeEvpCipherCtxHandle ctx, Span<byte> tag) 167internal static void EvpCipherGetAeadTag(SafeEvpCipherCtxHandle ctx, Span<byte> tag) 212internal static void EvpCipherGetCcmTag(SafeEvpCipherCtxHandle ctx, Span<byte> tag)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.cs (10)
27Span<byte> md, 38private static unsafe partial int EvpDigestFinalXOF(SafeEvpMdCtxHandle ctx, Span<byte> md, uint len); 41private static unsafe partial int EvpDigestCurrentXOF(SafeEvpMdCtxHandle ctx, Span<byte> md, uint len); 50private static unsafe partial int EvpDigestXOFOneShot(IntPtr type, ReadOnlySpan<byte> source, int sourceSize, Span<byte> md, uint len); 66Span<byte> pDestination, 74Span<byte> destination) 87internal static unsafe int EvpDigestFinalXOF(SafeEvpMdCtxHandle ctx, Span<byte> destination) 92internal static unsafe int EvpDigestCurrentXOF(SafeEvpMdCtxHandle ctx, Span<byte> destination) 97internal static unsafe int EvpDigestXOFOneShot(IntPtr type, ReadOnlySpan<byte> source, Span<byte> destination) 102internal static int EvpDigestSqueeze(SafeEvpMdCtxHandle ctx, Span<byte> destination)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.Mac.cs (6)
35private static partial int CryptoNative_EvpMacFinal(SafeEvpMacCtxHandle ctx, Span<byte> mac, int macLength); 41private static partial int CryptoNative_EvpMacCurrent(SafeEvpMacCtxHandle ctx, Span<byte> mac, int macLength); 52Span<byte> destination, 61Span<byte> destination, 85internal static void EvpMacFinal(SafeEvpMacCtxHandle ctx, Span<byte> mac) 97internal static void EvpMacCurrent(SafeEvpMacCtxHandle ctx, Span<byte> mac)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.Ecdh.cs (1)
26internal static void EvpPKeyDeriveSecretAgreement(SafeEvpPKeyCtxHandle ctx, Span<byte> destination)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.Rsa.cs (3)
63Span<byte> destination) 98Span<byte> destination) 133Span<byte> destination)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Hmac.cs (1)
34internal static unsafe int HmacOneShot(IntPtr type, ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
21public override Span<T> GetSpan()
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (1)
68Span<byte> derived = stackalloc byte[expectedOutputSize];
src\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (5)
203Span<byte> signDestination = stackalloc byte[SignatureStackBufSize]; 211Span<byte> destination, 223Span<byte> destination, 229Span<byte> signDestination = stackalloc byte[SignatureStackBufSize]; 283Span<byte> destination,
src\libraries\Common\src\System\Security\Cryptography\EccKeyFormatHelper.cs (2)
772Span<byte> basePointBytes = stackalloc byte[MaxStackAllocSize]; 800Span<byte> publicKeyBytes = stackalloc byte[MaxStackAllocSize];
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanDerivation.cs (5)
150Span<byte> part2 = stackalloc byte[ret.Length]; 180Span<byte> ret) 192Span<byte> retSpan = ret; 196Span<byte> a = stackalloc byte[hashOutputSize]; 197Span<byte> p = stackalloc byte[hashOutputSize];
src\libraries\Common\src\System\Security\Cryptography\ECDsaOpenSsl.cs (6)
92Span<byte> signDestination = stackalloc byte[SignatureStackBufSize]; 99public override bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) 110Span<byte> destination, 118Span<byte> signDestination = stackalloc byte[SignatureStackBufSize]; 166Span<byte> destination, 209Span<byte> derSignature = stackalloc byte[SignatureStackBufSize];
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
56internal static bool TryCopyToDestination(this ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten)
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (3)
192Span<byte> encryptedSpan = default; 196Span<byte> iv = stackalloc byte[cipher.BlockSize / 8]; 197Span<byte> salt = stackalloc byte[16];
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (22)
73Span<byte> destination) 171Span<byte> buf = stackalloc byte[128]; 318Span<byte> ivDest) 459Span<byte> destination) 461Span<byte> buf = stackalloc byte[128]; 518Span<byte> destination) 541Span<byte> iv = stackalloc byte[16]; 572ref Span<byte> iv) 693ref Span<byte> iv) 814Span<byte> destination) 839Span<byte> dk = stackalloc byte[16]; 848Span<byte> k = dk.Slice(0, 8); 849Span<byte> iv = dk.Slice(8, 8); 866Span<byte> destination) 890Span<byte> iv = stackalloc byte[cipher.BlockSize / 8]; 891Span<byte> key = stackalloc byte[cipher.KeySize / 8]; 924Span<byte> destination) 962Span<byte> tmpEndSpan = tmpEnd.AsSpan(); 986Span<byte> dk) 990Span<byte> t = stackalloc byte[20]; 1027Span<byte> salt, 1030Span<byte> iv)
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (13)
34Span<byte> destination) 50Span<byte> destination) 66Span<byte> destination) 83Span<byte> destination) 108Span<byte> D = stackalloc byte[vBytes]; 168Span<byte> hashBuf = stackalloc byte[uBytes]; 169Span<byte> bBuf = stackalloc byte[vBytes]; 219Span<byte> I_j = I.Slice(j * vBytes, vBytes); 237private static void AddPlusOne(Span<byte> into, Span<byte> addend) 251private static void CircularCopy(ReadOnlySpan<byte> bytes, Span<byte> destination) 270private static void CircularCopyUtf16BE(ReadOnlySpan<char> password, Span<byte> destination) 289Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length));
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (15)
92Span<byte> destination = default; 111Span<byte> destination, 127Span<byte> tmp = stackalloc byte[512]; 171Span<byte> destination, 232public override bool TryEncrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 245Span<byte> destination, 301private bool TryExportPrivateKey(TryExportPrivateKeySelector selector, Span<byte> destination, out int bytesWritten) 339Span<byte> destination, 364public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 374public override bool TryExportRSAPrivateKey(Span<byte> destination, out int bytesWritten) 395public override bool TryExportRSAPublicKey(Span<byte> destination, out int bytesWritten) 413public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) 737Span<byte>.Empty, 753Span<byte> destination, 776Span<byte> destination,
src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (28)
120Span<byte> destination) 134Span<byte> mInEM = destination.Slice(destination.Length - source.Length); 135Span<byte> ps = destination.Slice(2, destination.Length - source.Length - 3); 148Span<byte> destination, 252Span<byte> destination) 291Span<byte> destination) 297Span<byte> dbMaskSpan = Span<byte>.Empty; 316Span<byte> seed = destination.Slice(1, hLen); 317Span<byte> db = destination.Slice(1 + hLen); 324Span<byte> lHash = db.Slice(0, hLen); 325Span<byte> mDest = db.Slice(db.Length - source.Length); 326Span<byte> ps = db.Slice(hLen, db.Length - hLen - 1 - mDest.Length); 327Span<byte> psEnd = db.Slice(hLen + ps.Length, 1); 357Span<byte> seedMask = stackalloc byte[hLen]; 382internal static void EncodePss(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> mHash, Span<byte> destination, int keySize) 412Span<byte> em = destination.Slice(destination.Length - emLen, emLen); 416Span<byte> db = em.Slice(0, dbLen); 417Span<byte> hDest = em.Slice(dbLen, hLen); 421Span<byte> dbMask = new Span<byte>(dbMaskRented, 0, dbLen); 427Span<byte> salt = stackalloc byte[sLen]; 518Span<byte> dbMask = new Span<byte>(dbMaskRented, 0, maskedDb.Length); 562Span<byte> hPrime = stackalloc byte[hLen]; 585private static void Mgf1(IncrementalHash hasher, ReadOnlySpan<byte> mgfSeed, Span<byte> mask) 588Span<byte> writePtr = mask; 590Span<byte> bigEndianCount = stackalloc byte[sizeof(int)]; 611Span<byte> tmp = stackalloc byte[hLen]; 631private static void Xor(Span<byte> a, ReadOnlySpan<byte> b)
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdf.cs (8)
283public static void DeriveBytes(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination) 363public static void DeriveBytes(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination) 443public void DeriveKey(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination) 494public void DeriveKey(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination) 599Span<byte> destination); 606Span<byte> destination); 608private void DeriveKeyCore(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination) 613private void DeriveKeyCore(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination)
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationBase.cs (3)
8internal abstract void DeriveBytes(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination); 9internal abstract void DeriveBytes(byte[] label, byte[] context, Span<byte> destination); 10internal abstract void DeriveBytes(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination);
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (3)
20internal override void DeriveBytes(ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination) 34internal override void DeriveBytes(ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination) 48internal override void DeriveBytes(byte[] label, byte[] context, Span<byte> destination)
src\libraries\Common\src\System\Security\Cryptography\Utf8DataEncoding.cs (2)
13private readonly Span<byte> _buffer; 15internal Utf8DataEncoding(ReadOnlySpan<char> data, Span<byte> stackBuffer)
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (1)
33Span<char> dest = urlEncoded;
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (3)
16private Span<byte> _bytes; 18public ValueUtf8Converter(Span<byte> initialBuffer) 24public Span<byte> ConvertAndTerminateString(ReadOnlySpan<char> value)
System\Security\Cryptography\AesCcm.cs (3)
48Span<byte> ciphertext, 49Span<byte> tag, 70Span<byte> plaintext,
System\Security\Cryptography\AesCcm.OpenSsl.cs (7)
29Span<byte> ciphertext, 30Span<byte> tag, 46Interop.Crypto.EvpCipherSetKeyAndIV(ctx, Span<byte>.Empty, Span<byte>.Empty, Interop.Crypto.EvpCipherDirection.Encrypt); 56if (!Interop.Crypto.EvpCipherUpdate(ctx, Span<byte>.Empty, out _, associatedData)) 99Span<byte> plaintext, 122if (!Interop.Crypto.EvpCipherUpdate(ctx, Span<byte>.Empty, out _, associatedData))
System\Security\Cryptography\AesGcm.cs (3)
116Span<byte> ciphertext, 117Span<byte> tag, 138Span<byte> plaintext,
System\Security\Cryptography\AesGcm.OpenSsl.cs (7)
26Span<byte>.Empty, 34Span<byte> ciphertext, 35Span<byte> tag, 40Span<byte>.Empty, 46if (!Interop.Crypto.EvpCipherUpdate(_ctxHandle, Span<byte>.Empty, out _, associatedData)) 80Span<byte> plaintext, 91if (!Interop.Crypto.EvpCipherUpdate(_ctxHandle, Span<byte>.Empty, out _, associatedData))
System\Security\Cryptography\AesImplementation.cs (6)
47Span<byte> destination, 68Span<byte> destination, 90Span<byte> destination, 112Span<byte> destination, 134Span<byte> destination, 159Span<byte> destination,
System\Security\Cryptography\AsymmetricAlgorithm.cs (20)
145Span<byte> destination, 154Span<byte> destination, 160public virtual bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) => 163public virtual bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) => 425/// <see cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{char}, PbeParameters, Span{byte}, out int)" /> has not been provided. 478/// <see cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{byte}, PbeParameters, Span{byte}, out int)" /> has not been provided. 578public bool TryExportSubjectPublicKeyInfoPem(Span<char> destination, out int charsWritten) 580static bool Export(AsymmetricAlgorithm alg, Span<byte> destination, out int bytesWritten) 627public bool TryExportPkcs8PrivateKeyPem(Span<char> destination, out int charsWritten) 629static bool Export(AsymmetricAlgorithm alg, Span<byte> destination, out int bytesWritten) 665/// An implementation for <see cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{char}, PbeParameters, Span{byte}, out int)" /> 688public bool TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char> password, PbeParameters pbeParameters, Span<char> destination, out int charsWritten) 694Span<byte> destination, 732/// An implementation for <see cref="TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan{byte}, PbeParameters, Span{byte}, out int)" /> 750public bool TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters, Span<char> destination, out int charsWritten) 756Span<byte> destination, 774Span<byte> destination, 777private delegate bool TryExport(Span<byte> destination, out int bytesWritten); 798Span<byte> writtenSpan = new Span<byte>(buf, 0, bytesWritten); 828Span<byte> writtenSpan = new Span<byte>(buf, 0, bytesWritten);
System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (3)
26Span<byte> destination, 63internal static int ConvertDerToIeee1363(ReadOnlySpan<byte> input, int fieldSizeBits, Span<byte> destination) 190private static void CopySignatureField(ReadOnlySpan<byte> signatureField, Span<byte> response)
System\Security\Cryptography\Base64Transforms.cs (10)
48Span<byte> input = inputBuffer.AsSpan(inputOffset, inputCount); 49Span<byte> output = outputBuffer.AsSpan(outputOffset, requiredOutputLength); 69Span<byte> input = inputBuffer.AsSpan(inputOffset, inputCount); 155Span<byte> transformBuffer = stackalloc byte[StackAllocSize]; 200Span<byte> transformBuffer = stackalloc byte[StackAllocSize]; 236private Span<byte> AppendInputBuffers(ReadOnlySpan<byte> inputBuffer, Span<byte> transformBuffer) 270private static int GetOutputSize(int bytesToTransform, Span<byte> tmpBuffer) 292private void ConvertFromBase64(Span<byte> transformBuffer, Span<byte> outputBuffer, out int consumed, out int written)
System\Security\Cryptography\BasicSymmetricCipher.cs (2)
30public abstract int Transform(ReadOnlySpan<byte> input, Span<byte> output); 32public abstract int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output);
System\Security\Cryptography\ChaCha20Poly1305.cs (3)
61Span<byte> ciphertext, 62Span<byte> tag, 83Span<byte> plaintext,
System\Security\Cryptography\ChaCha20Poly1305.OpenSsl.cs (7)
26Span<byte>.Empty, 33Span<byte> ciphertext, 34Span<byte> tag, 39Span<byte>.Empty, 45if (!Interop.Crypto.EvpCipherUpdate(_ctxHandle, Span<byte>.Empty, out _, associatedData)) 79Span<byte> plaintext, 90if (!Interop.Crypto.EvpCipherUpdate(_ctxHandle, Span<byte>.Empty, out _, associatedData))
System\Security\Cryptography\ConcurrentSafeKmac.cs (2)
26public int Current(Span<byte> destination) 34public int Finalize(Span<byte> destination)
System\Security\Cryptography\CryptographicOperations.cs (7)
61public static void ZeroMemory(Span<byte> buffer) 149public static int HashData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> source, Span<byte> destination) 185public static bool TryHashData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 262public static int HashData(HashAlgorithmName hashAlgorithm, Stream source, Span<byte> destination) 458Span<byte> destination) 499Span<byte> destination, 612public static int HmacData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\DesImplementation.cs (6)
98Span<byte> destination, 119Span<byte> destination, 141Span<byte> destination, 163Span<byte> destination, 185Span<byte> destination, 210Span<byte> destination,
System\Security\Cryptography\DSA.cs (16)
227Span<byte> signature = stackalloc byte[SignatureStackSize]; 434Span<byte> signature = stackalloc byte[SignatureStackSize]; 446public virtual bool TryCreateSignature(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) 472Span<byte> destination, 502Span<byte> destination, 521Span<byte> destination, 539Span<byte> destination, 582Span<byte> destination, 615Span<byte> destination, 620Span<byte> tmp = stackalloc byte[HashBufferStackSize]; 781Span<byte> tmp = stackalloc byte[HashBufferStackSize]; 881Span<byte> tmp) 924Span<byte> destination, 947Span<byte> destination, 967Span<byte> destination, 975Span<byte> destination,
System\Security\Cryptography\DSACryptoServiceProvider.Unix.cs (3)
72public override bool TryCreateSignature(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) => 117protected override bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) 219public override bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten)
System\Security\Cryptography\DSAWrapper.cs (6)
49public override bool TryCreateSignature(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) => 54Span<byte> destination, 71Span<byte> destination, 78Span<byte> destination, 82public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) => 85public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\ECAlgorithm.cs (7)
131Span<byte> destination, 203Span<byte> destination, 256Span<byte> destination, 296Span<byte> destination, 651public virtual unsafe bool TryExportECPrivateKey(Span<byte> destination, out int bytesWritten) 927public bool TryExportECPrivateKeyPem(Span<char> destination, out int charsWritten) 929static bool Export(ECAlgorithm alg, Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\ECDiffieHellmanPublicKey.ExportParameters.cs (1)
50public virtual bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\ECDiffieHellmanWrapper.cs (5)
68Span<byte> destination, 75Span<byte> destination, 85public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) => 111public override bool TryExportECPrivateKey(Span<byte> destination, out int bytesWritten) => 187public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\ECDsa.cs (24)
141Span<byte> signature = stackalloc byte[SignatureStackBufSize]; 363/// <seealso cref="SignHash(ReadOnlySpan{byte}, Span{byte})" />. 364public int SignHash(ReadOnlySpan<byte> hash, Span<byte> destination, DSASignatureFormat signatureFormat) 397/// the signature. To use a different signature format, use <see cref="SignHash(ReadOnlySpan{byte}, Span{byte}, DSASignatureFormat)" />. 399/// <seealso cref="SignHash(ReadOnlySpan{byte}, Span{byte}, DSASignatureFormat)" />. 400public int SignHash(ReadOnlySpan<byte> hash, Span<byte> destination) 423Span<byte> signature = stackalloc byte[SignatureStackBufSize]; 464Span<byte> destination, 470Span<byte> hashTmp = stackalloc byte[HashBufferStackSize]; 502Span<byte> destination, 535Span<byte> destination, 540Span<byte> hashTmp = stackalloc byte[HashBufferStackSize]; 654/// <seealso cref="SignData(ReadOnlySpan{byte}, Span{byte}, HashAlgorithmName)" /> 657Span<byte> destination, 704/// <see cref="SignData(ReadOnlySpan{byte}, Span{byte}, HashAlgorithmName, DSASignatureFormat)" />. 706/// <seealso cref="SignData(ReadOnlySpan{byte}, Span{byte}, HashAlgorithmName, DSASignatureFormat)" /> 707public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm) 845Span<byte> hashTmp = stackalloc byte[HashBufferStackSize]; 899Span<byte> hashSpan = stackalloc byte[512 / 8]; 998protected virtual bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) 1041public virtual bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) 1067Span<byte> destination, 1097Span<byte> destination, 1201Span<byte> tmp)
System\Security\Cryptography\ECDsaWrapper.cs (6)
28Span<byte> destination, 99Span<byte> destination, 134Span<byte> destination, 141Span<byte> destination, 151public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) => 172public override bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\HashAlgorithm.cs (2)
53public bool TryComputeHash(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 261protected virtual bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\HashProvider.cs (3)
35public abstract int FinalizeHashAndReset(Span<byte> destination); 37public abstract int GetCurrentHash(Span<byte> destination); 49public bool TryFinalizeHashAndReset(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\HashProviderDispenser.OpenSsl.cs (2)
30Span<byte> destination, 45public static unsafe void HashDataXof(string hashAlgorithmId, ReadOnlySpan<byte> source, Span<byte> destination)
System\Security\Cryptography\HashProviderDispenser.Unix.cs (6)
38Span<byte> destination) 56public static unsafe int HashData(string hashAlgorithmId, ReadOnlySpan<byte> source, Span<byte> destination) 106public override int FinalizeHashAndReset(Span<byte> destination) 117public override int GetCurrentHash(Span<byte> destination) 168public override int FinalizeHashAndReset(Span<byte> destination) 179public override int GetCurrentHash(Span<byte> destination)
System\Security\Cryptography\Helpers.cs (1)
336internal static unsafe ref byte GetNonNullPinnableReference(Span<byte> buffer)
System\Security\Cryptography\HKDF.cs (14)
48public static int Extract(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> ikm, ReadOnlySpan<byte> salt, Span<byte> prk) 66private static void Extract(HashAlgorithmName hashAlgorithmName, int hashLength, ReadOnlySpan<byte> ikm, ReadOnlySpan<byte> salt, Span<byte> prk) 112public static void Expand(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> prk, Span<byte> output, ReadOnlySpan<byte> info) 127private static void Expand(HashAlgorithmName hashAlgorithmName, int hashLength, ReadOnlySpan<byte> prk, Span<byte> output, ReadOnlySpan<byte> info) 135var counterSpan = new Span<byte>(ref counter); 136Span<byte> t = Span<byte>.Empty; 137Span<byte> remainingOutput = output; 140Span<byte> tempInfoBuffer = stackalloc byte[MaxStackInfoBuffer]; 181Span<byte> lastChunk = stackalloc byte[hashLength]; 222Span<byte> prk = stackalloc byte[hashLength]; 241public static void DeriveKey(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> ikm, Span<byte> output, ReadOnlySpan<byte> salt, ReadOnlySpan<byte> info) 254Span<byte> prk = stackalloc byte[hashLength]; 260private static void GetHashAndReset(IncrementalHash hmac, Span<byte> output)
System\Security\Cryptography\HMAC.cs (1)
71protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\HMACCommon.cs (3)
117public int FinalizeHashAndReset(Span<byte> destination) => 120public bool TryFinalizeHashAndReset(Span<byte> destination, out int bytesWritten) => 123public int GetCurrentHash(Span<byte> destination) =>
System\Security\Cryptography\HMACMD5.cs (4)
74protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 126public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 150public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 185public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA1.cs (4)
80protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 129public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 152public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 186public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA256.cs (4)
72protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 121public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 144public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 178public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA3_256.cs (4)
107protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 157public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 180public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 216public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA3_384.cs (4)
107protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 157public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 180public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 216public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA3_512.cs (4)
107protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 157public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 180public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 216public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA384.cs (4)
89protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 138public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 161public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 195public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\HMACSHA512.cs (4)
86protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten) => 135public static int HashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination) 158public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 192public static int HashData(ReadOnlySpan<byte> key, Stream source, Span<byte> destination)
System\Security\Cryptography\ILiteSymmetricCipher.cs (2)
10int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output); 11int Transform(ReadOnlySpan<byte> input, Span<byte> output);
System\Security\Cryptography\IncrementalHash.cs (8)
147/// <paramref name="destination"/> has a <see cref="Span{T}.Length"/> value less 151public int GetHashAndReset(Span<byte> destination) 160public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten) 174private int GetHashAndResetCore(Span<byte> destination) 219/// <paramref name="destination"/> has a <see cref="Span{T}.Length"/> value less 223public int GetCurrentHash(Span<byte> destination) 250public bool TryGetCurrentHash(Span<byte> destination, out int bytesWritten) 264private int GetCurrentHashCore(Span<byte> destination)
System\Security\Cryptography\Kmac128.cs (7)
119/// <seealso cref="GetCurrentHash(Span{byte})" /> 120public void GetHashAndReset(Span<byte> destination) 159/// <seealso cref="GetHashAndReset(Span{byte})" /> 160public void GetCurrentHash(Span<byte> destination) 258Span<byte> destination, 359Span<byte> destination, 505Span<byte> destination,
System\Security\Cryptography\Kmac256.cs (7)
119/// <seealso cref="GetCurrentHash(Span{byte})" /> 120public void GetHashAndReset(Span<byte> destination) 159/// <seealso cref="GetHashAndReset(Span{byte})" /> 160public void GetCurrentHash(Span<byte> destination) 258Span<byte> destination, 359Span<byte> destination, 505Span<byte> destination,
System\Security\Cryptography\KmacXof128.cs (7)
119/// <seealso cref="GetCurrentHash(Span{byte})" /> 120public void GetHashAndReset(Span<byte> destination) 159/// <seealso cref="GetHashAndReset(Span{byte})" /> 160public void GetCurrentHash(Span<byte> destination) 258Span<byte> destination, 359Span<byte> destination, 505Span<byte> destination,
System\Security\Cryptography\KmacXof256.cs (7)
119/// <seealso cref="GetCurrentHash(Span{byte})" /> 120public void GetHashAndReset(Span<byte> destination) 159/// <seealso cref="GetHashAndReset(Span{byte})" /> 160public void GetCurrentHash(Span<byte> destination) 258Span<byte> destination, 359Span<byte> destination, 505Span<byte> destination,
System\Security\Cryptography\LiteHash.OpenSsl.cs (2)
55public int Current(Span<byte> destination) 61public int Finalize(Span<byte> destination)
System\Security\Cryptography\LiteHash.Unix.cs (7)
68public int Finalize(Span<byte> destination) 74public void Current(Span<byte> destination) 86public void Read(Span<byte> destination) 143public int Finalize(Span<byte> destination) 159public int Current(Span<byte> destination) 216public int Current(Span<byte> destination) 226public int Finalize(Span<byte> destination)
System\Security\Cryptography\LiteHashProvider.cs (4)
13internal static int HashStream(string hashAlgorithmId, Stream source, Span<byte> destination) 61Span<byte> destination) 112private static int ProcessStream<T>(T hash, Stream source, Span<byte> destination) where T : ILiteHash 189int Finalize(Span<byte> destination);
System\Security\Cryptography\LiteHashProvider.Xof.cs (2)
13internal static void XofStream(string hashAlgorithmId, Stream source, Span<byte> destination) 35Span<byte> destination)
System\Security\Cryptography\MD5.cs (4)
87public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 108public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 142public static int HashData(Stream source, Span<byte> destination) 266protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\MD5CryptoServiceProvider.cs (2)
26Span<byte> destination = stackalloc byte[HashSizeInBytes]; 56protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\OpenSslAsnFormatter.cs (2)
62Span<byte> buffer = new byte[printLen + 1]; 63Span<byte> current = buffer;
System\Security\Cryptography\OpenSslCipher.cs (2)
35public override unsafe int Transform(ReadOnlySpan<byte> input, Span<byte> output) 42public override int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output)
System\Security\Cryptography\OpenSslCipherLite.cs (6)
50public int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output) 72Span<byte> outputSpan = rented.AsSpan(written); 86Span<byte> outputSpan = output.Slice(written); 93public unsafe int Transform(ReadOnlySpan<byte> input, Span<byte> output) 107Span<byte> tmpSpan = tmp; 140private int CipherUpdate(ReadOnlySpan<byte> input, Span<byte> output)
System\Security\Cryptography\Pbkdf2Implementation.OpenSsl.cs (1)
15Span<byte> destination)
System\Security\Cryptography\PemEncoding.cs (7)
80Span<char> postebStackBuffer = stackalloc char[PostebStackBufferSize]; 119Span<char> postebBuffer = postebLength > PostebStackBufferSize 168static ReadOnlySpan<char> WritePostEB(ReadOnlySpan<char> label, Span<char> destination) 377public static bool TryWrite(ReadOnlySpan<char> label, ReadOnlySpan<byte> data, Span<char> destination, out int charsWritten) 395private static int WriteCore(ReadOnlySpan<char> label, ReadOnlySpan<byte> data, Span<char> destination) 397static int Write(ReadOnlySpan<char> str, Span<char> dest, int offset) 403static int WriteBase64(ReadOnlySpan<byte> bytes, Span<char> dest, int offset)
System\Security\Cryptography\PemKeyHelpers.cs (8)
12public delegate bool TryExportKeyAction<T>(T arg, Span<byte> destination, out int bytesWritten); 17Span<byte> destination, 25Span<char> destination, 43Span<byte> writtenSpan = new Span<byte>(buffer, 0, bytesWritten); 61Span<char> destination, 79Span<byte> writtenSpan = new Span<byte>(buffer, 0, bytesWritten); 151Span<byte> decodedBase64 = decodeBuffer.AsSpan(0, bytesWritten); 237Span<byte> decodedBase64 = decodeBuffer.AsSpan(0, bytesWritten);
System\Security\Cryptography\RandomNumberGenerator.cs (17)
56public virtual void GetBytes(Span<byte> data) 79public virtual void GetNonZeroBytes(Span<byte> data) 98public static void Fill(Span<byte> data) 129Span<byte> oneUintBytes = MemoryMarshal.AsBytes(new Span<uint>(ref oneUint)); 178/// <seealso cref="GetHexString(Span{char}, bool)" /> 179public static void GetItems<T>(ReadOnlySpan<T> choices, Span<T> destination) 201/// <seealso cref="GetHexString(Span{char}, bool)" /> 226/// <seealso cref="GetItems{T}(ReadOnlySpan{T}, Span{T})" /> 228/// <seealso cref="GetHexString(Span{char}, bool)" /> 255/// The behavior of this is the same as using <seealso cref="GetItems{T}(ReadOnlySpan{T}, Span{T})" /> and 259public static void GetHexString(Span<char> destination, bool lowercase = false) 294public static void Shuffle<T>(Span<T> values) 311private static void GetHexStringCore(Span<char> destination, bool lowercase) 316Span<byte> randomBuffer = stackalloc byte[RandomBufferSize]; 322Span<byte> remainingRandom = randomBuffer.Slice(0, Math.Min(RandomBufferSize, needed)); 352private static void GetItemsCore<T>(ReadOnlySpan<T> choices, Span<T> destination) 364Span<byte> randomBytes = stackalloc byte[512];
System\Security\Cryptography\RandomNumberGeneratorImplementation.cs (5)
19internal static unsafe void FillSpan(Span<byte> data) 40public override unsafe void GetBytes(Span<byte> data) 55public override void GetNonZeroBytes(Span<byte> data) 60internal static void FillNonZeroBytes(Span<byte> data) 76Span<byte> remainder = data.Slice(first0Byte + 1);
System\Security\Cryptography\RC2Implementation.cs (6)
84Span<byte> destination, 108Span<byte> destination, 133Span<byte> destination, 158Span<byte> destination, 183Span<byte> destination, 194Span<byte> destination,
System\Security\Cryptography\Rfc2898DeriveBytes.cs (2)
180internal void GetBytes(Span<byte> destination) 293Span<byte> uiSpan = stackalloc byte[64];
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (7)
115Span<byte> destination, 245/// and use <see cref="Pbkdf2(ReadOnlySpan{byte}, ReadOnlySpan{byte}, Span{byte}, int, HashAlgorithmName)" />. 250Span<byte> destination, 264Span<byte> destination, 281Span<byte> passwordBuffer = maxEncodedSize > MaxPasswordStackSize ? 285Span<byte> passwordBytes = passwordBuffer.Slice(0, passwordBytesWritten); 305Span<byte> destination,
System\Security\Cryptography\RNGCryptoServiceProvider.cs (2)
29public override void GetBytes(Span<byte> data) => _impl.GetBytes(data); 31public override void GetNonZeroBytes(Span<byte> data) => _impl.GetNonZeroBytes(data);
System\Security\Cryptography\RSA.cs (21)
102public virtual bool TryDecrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 117public virtual bool TryEncrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 159/// <seealso cref="Encrypt(ReadOnlySpan{byte}, Span{byte}, RSAEncryptionPadding)" /> 211public int Encrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding) 246/// <seealso cref="Decrypt(ReadOnlySpan{byte}, Span{byte}, RSAEncryptionPadding)" /> 294public int Decrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding) 306protected virtual bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) 341public virtual bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 411public virtual bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 517Span<byte> destination, 619Span<byte> destination, 705public virtual bool TryExportRSAPrivateKey(Span<byte> destination, out int bytesWritten) 717public virtual bool TryExportRSAPublicKey(Span<byte> destination, out int bytesWritten) 723public override unsafe bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) 759public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) 804Span<byte> destination, 827Span<byte> destination, 1332public bool TryExportRSAPrivateKeyPem(Span<char> destination, out int charsWritten) 1334static bool Export(RSA alg, Span<byte> destination, out int bytesWritten) 1378public bool TryExportRSAPublicKeyPem(Span<char> destination, out int charsWritten) 1380static bool Export(RSA alg, Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\RSACryptoServiceProvider.Unix.cs (4)
64public override bool TryDecrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 103public override bool TryEncrypt(ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) 205public override bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 242public override bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten)
System\Security\Cryptography\RSAWrapper.cs (10)
71Span<byte> destination, 78Span<byte> destination, 85Span<byte> destination, 119Span<byte> destination, 143public override bool TryExportRSAPrivateKey(Span<byte> destination, out int bytesWritten) => 148public override bool TryExportRSAPublicKey(Span<byte> destination, out int bytesWritten) => 151public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) => 154public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) => 160Span<byte> destination, 167Span<byte> destination,
System\Security\Cryptography\SHA1.cs (4)
83public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 103public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 136public static int HashData(Stream source, Span<byte> destination) 257protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA1CryptoServiceProvider.cs (2)
29Span<byte> destination = stackalloc byte[HashSizeInBytes]; 59protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\SHA1Managed.cs (1)
31protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA256.cs (4)
82public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 103public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 136public static int HashData(Stream source, Span<byte> destination) 257protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA256CryptoServiceProvider.cs (2)
29Span<byte> destination = stackalloc byte[HashSizeInBytes]; 59protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\SHA256Managed.cs (1)
31protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA3_256.cs (4)
111public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 134public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 172public static int HashData(Stream source, Span<byte> destination) 312protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA3_384.cs (4)
111public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 135public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 173public static int HashData(Stream source, Span<byte> destination) 313protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA3_512.cs (4)
111public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 134public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 172public static int HashData(Stream source, Span<byte> destination) 312protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA384.cs (4)
82public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 102public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 135public static int HashData(Stream source, Span<byte> destination) 256protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA384CryptoServiceProvider.cs (2)
29Span<byte> destination = stackalloc byte[HashSizeInBytes]; 59protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\SHA384Managed.cs (1)
31protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA512.cs (4)
82public static int HashData(ReadOnlySpan<byte> source, Span<byte> destination) 102public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 135public static int HashData(Stream source, Span<byte> destination) 256protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\SHA512CryptoServiceProvider.cs (2)
29Span<byte> destination = stackalloc byte[HashSizeInBytes]; 59protected override bool TryHashFinal(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\SHA512Managed.cs (1)
31protected sealed override bool TryHashFinal(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\Shake128.cs (9)
116/// <seealso cref="GetCurrentHash(Span{byte})" /> 117public void GetHashAndReset(Span<byte> destination) 160/// <seealso cref="GetHashAndReset(Span{byte})" /> 161public void GetCurrentHash(Span<byte> destination) 209/// The platform does not support multiple reads of the hash. <see cref="GetHashAndReset(Span{byte})" /> can be used 212public void Read(Span<byte> destination) 327public static void HashData(ReadOnlySpan<byte> source, Span<byte> destination) 381public static void HashData(Stream source, Span<byte> destination) 472private static void HashDataCore(ReadOnlySpan<byte> source, Span<byte> destination)
System\Security\Cryptography\Shake256.cs (9)
116/// <seealso cref="GetCurrentHash(Span{byte})" /> 117public void GetHashAndReset(Span<byte> destination) 160/// <seealso cref="GetHashAndReset(Span{byte})" /> 161public void GetCurrentHash(Span<byte> destination) 209/// The platform does not support multiple reads of the hash. <see cref="GetHashAndReset(Span{byte})" /> can be used 212public void Read(Span<byte> destination) 327public static void HashData(ReadOnlySpan<byte> source, Span<byte> destination) 381public static void HashData(Stream source, Span<byte> destination) 472private static void HashDataCore(ReadOnlySpan<byte> source, Span<byte> destination)
System\Security\Cryptography\SP800108HmacCounterKdf.Managed.cs (2)
39Span<byte> destination) 49Span<byte> destination)
System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (5)
26Span<byte> destination) 43Span<byte> iBuffer = stackalloc byte[sizeof(uint)]; 44Span<byte> lBuffer = stackalloc byte[sizeof(uint)]; 46Span<byte> hmacBuffer = stackalloc byte[512 / 8]; // Largest HMAC supported is SHA512 85Span<byte> destination)
System\Security\Cryptography\SymmetricAlgorithm.cs (19)
509public int DecryptEcb(ReadOnlySpan<byte> ciphertext, Span<byte> destination, PaddingMode paddingMode) 538public bool TryDecryptEcb(ReadOnlySpan<byte> ciphertext, Span<byte> destination, PaddingMode paddingMode, out int bytesWritten) 627public int EncryptEcb(ReadOnlySpan<byte> plaintext, Span<byte> destination, PaddingMode paddingMode) 656public bool TryEncryptEcb(ReadOnlySpan<byte> plaintext, Span<byte> destination, PaddingMode paddingMode, out int bytesWritten) 724Span<byte> decryptBuffer = decryptRent.AsSpan(0, ciphertext.Length); 769Span<byte> destination, 808Span<byte> destination, 922Span<byte> destination, 961Span<byte> destination, 1141Span<byte> destination, 1200Span<byte> destination, 1373Span<byte> destination, 1432Span<byte> destination, 1466Span<byte> destination, 1490Span<byte> destination, 1521Span<byte> destination, 1547Span<byte> destination, 1575Span<byte> destination, 1608Span<byte> destination,
System\Security\Cryptography\SymmetricPadding.cs (1)
36public static int PadBlock(ReadOnlySpan<byte> block, Span<byte> destination, int paddingSizeInBytes, PaddingMode paddingMode)
System\Security\Cryptography\TripleDesImplementation.cs (6)
95Span<byte> destination, 116Span<byte> destination, 138Span<byte> destination, 160Span<byte> destination, 182Span<byte> destination, 207Span<byte> destination,
System\Security\Cryptography\UniversalCryptoDecryptor.cs (4)
26protected override int UncheckedTransformBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer) 68protected override unsafe int UncheckedTransformFinalBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer) 80Span<byte> ciphertext; 112Span<byte> decryptedBytes = ciphertext.Slice(0, decryptWritten);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (2)
26protected override int UncheckedTransformBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer) 31protected override int UncheckedTransformFinalBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer)
System\Security\Cryptography\UniversalCryptoOneShot.cs (9)
17Span<byte> output, 32Span<byte> transformBuffer = output.Slice(0, bytesTransformed); 74Span<byte> stackBuffer = stackalloc byte[MaxInStackDecryptionBuffer]; 83Span<byte> writtenDepadded = stackBuffer.Slice(0, depaddedLength); 134Span<byte> depaddedFinalTransform = stackBuffer.Slice(0, depaddedLength); 160Span<byte> buffer = rentedBuffer.AsSpan(0, input.Length); 161Span<byte> decryptedBuffer = default; 199Span<byte> output, 218Span<byte> paddedOutput = output.Slice(0, padWritten);
System\Security\Cryptography\UniversalCryptoTransform.cs (2)
117protected abstract int UncheckedTransformBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer); 122protected abstract int UncheckedTransformFinalBlock(ReadOnlySpan<byte> inputBuffer, Span<byte> outputBuffer);
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
505Span<byte> serialNumber = stackalloc byte[8];
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (1)
50Span<byte> hashBuffer = stackalloc byte[SHA1.HashSizeInBytes];
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (1)
278Span<byte> hash = stackalloc byte[SHA256.HashSizeInBytes];
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (3)
713Span<byte> buffer = new byte[bioSize + 1]; 714Span<byte> current = buffer; 802Span<char> dateString = stackalloc char[Encoding.ASCII.GetCharCount(bytes)];
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (1)
282Span<IntPtr> tempChain = stackalloc IntPtr[DefaultChainCapacity];
System\Security\Cryptography\X509Certificates\PublicKey.cs (1)
118public bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) =>
System\Security\Cryptography\X509Certificates\UnixExportProvider.cs (9)
246Span<byte> salt = stackalloc byte[16]; 248Span<byte> certContentsIv = stackalloc byte[8]; 321Span<byte> salt, 323Span<byte> certContentsIv, 403Span<byte> salt, 404Span<byte> certContentsIv) 485Span<byte> macKey = stackalloc byte[HMACSHA1.HashSizeInBytes]; 486Span<byte> macSalt = stackalloc byte[HMACSHA1.HashSizeInBytes]; 487Span<byte> macSpan = stackalloc byte[HMACSHA1.HashSizeInBytes];
System\Security\Cryptography\X509Certificates\UnixPkcs12Reader.cs (2)
50Span<byte> tmpSpan = new Span<byte>((byte*)tmpPtr, encodedData.Length); 137Span<byte> tmp = manager.GetSpan();
System\Security\Cryptography\X509Certificates\X500DistinguishedNameBuilder.cs (1)
229Span<char> fixupTwoLetterCode = stackalloc char[2];
System\Security\Cryptography\X509Certificates\X500NameEncoder.cs (2)
487Span<char> destination = chars.Length > MaxStackAllocSize ? 545private static int ExtractValue(ReadOnlySpan<char> chars, Span<char> destination)
System\Security\Cryptography\X509Certificates\X509AuthorityKeyIdentifierExtension.cs (1)
251Span<byte> stackSpan = stackalloc byte[64];
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
356Span<byte> destination,
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
1169public bool TryExportCertificatePem(Span<char> destination, out int charsWritten)
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (3)
452public bool TryExportPkcs7Pem(Span<char> destination, out int charsWritten) 530public bool TryExportCertificatePems(Span<char> destination, out int charsWritten) 532Span<char> buffer = destination;
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (4)
172Span<byte> sha1 = stackalloc byte[SHA1.HashSizeInBytes]; 209Span<byte> hash = stackalloc byte[512 / 8]; // Largest known hash is 512-bits. 217Span<byte> hash = stackalloc byte[512 / 8]; // Largest known hash is 512-bits. 224Span<byte> spkiBuffer = encodedLength <= MaxSpkiStackSize ?
System\Security\Cryptography\XmlKeyHelper.cs (2)
106Span<byte> valBuf = stackalloc byte[sizeof(int)]; 140Span<char> base64 = stackalloc char[StackChars];
System.Security.Cryptography.Cose (32)
src\libraries\Common\src\System\Memory\PointerMemoryManager.cs (1)
21public override Span<T> GetSpan()
System\Security\Cryptography\Cose\CoseHeaderMap.cs (2)
117public int GetValueAsBytes(CoseHeaderLabel label, Span<byte> destination) => _headerParameters[label].GetValueAsBytes(destination); 332internal static int Encode(CoseHeaderMap? map, Span<byte> destination, bool isProtected = false, int? algHeaderValueToSlip = null)
System\Security\Cryptography\Cose\CoseHeaderValue.cs (1)
218public int GetValueAsBytes(Span<byte> destination)
System\Security\Cryptography\Cose\CoseHelpers.cs (10)
60Span<byte> buffer = stackalloc byte[1 + sizeof(ushort)]; 68Span<byte> buffer = stackalloc byte[1 + sizeof(uint)]; 76Span<byte> buffer = stackalloc byte[1 + sizeof(ulong)]; 107internal static int SignHash(CoseSigner signer, IncrementalHash hasher, Span<byte> destination) 124private static int SignHashWithECDsa(ECDsa key, IncrementalHash hasher, Span<byte> destination) 132Span<byte> hash = stackalloc byte[hasher.HashLengthInBytes]; 145private static int SignHashWithRSA(RSA key, IncrementalHash hasher, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, Span<byte> destination) 153Span<byte> hash = stackalloc byte[hasher.HashLengthInBytes]; 321internal static int WriteHeaderMap(Span<byte> buffer, CborWriter writer, CoseHeaderMap? headerMap, bool isProtected, int? algHeaderValueToSlip) 350internal static void WriteSignature(Span<byte> buffer, IncrementalHash hasher, CborWriter writer, CoseSigner signer)
System\Security\Cryptography\Cose\CoseMessage.cs (4)
409Span<byte> buffer, 487internal static int CreateToBeSigned(Span<byte> destination, SigStructureContext context, ReadOnlySpan<byte> bodyProtected, ReadOnlySpan<byte> signProtected, ReadOnlySpan<byte> associatedData, ReadOnlySpan<byte> content) 613public int Encode(Span<byte> destination) 632public abstract bool TryEncode(Span<byte> destination, out int bytesWritten);
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (7)
319public static bool TrySignDetached(ReadOnlySpan<byte> detachedContent, Span<byte> destination, CoseSigner signer, out int bytesWritten, CoseHeaderMap? protectedHeaders = null, CoseHeaderMap? unprotectedHeaders = null, ReadOnlySpan<byte> associatedData = default) 347public static bool TrySignEmbedded(ReadOnlySpan<byte> embeddedContent, Span<byte> destination, CoseSigner signer, out int bytesWritten, CoseHeaderMap? protectedHeaders = null, CoseHeaderMap? unprotectedHeaders = null, ReadOnlySpan<byte> associatedData = default) 350private static bool TrySign(ReadOnlySpan<byte> content, Span<byte> destination, CoseSigner signer, CoseHeaderMap? protectedHeaders, CoseHeaderMap? unprotectedHeaders, out int bytesWritten, ReadOnlySpan<byte> associatedData, bool isDetached) 373Span<byte> buffer, 448Span<byte> buffer, 574public override bool TryEncode(Span<byte> destination, out int bytesWritten) 797Span<byte> bufferSpan = buffer;
System\Security\Cryptography\Cose\CoseSign1Message.cs (6)
263public static bool TrySignDetached(ReadOnlySpan<byte> detachedContent, Span<byte> destination, CoseSigner signer, out int bytesWritten, ReadOnlySpan<byte> associatedData = default) 285public static bool TrySignEmbedded(ReadOnlySpan<byte> embeddedContent, Span<byte> destination, CoseSigner signer, out int bytesWritten, ReadOnlySpan<byte> associatedData = default) 288private static bool TrySign(ReadOnlySpan<byte> content, Span<byte> destination, CoseSigner signer, out int bytesWritten, ReadOnlySpan<byte> associatedData, bool isDetached) 321private static int CreateCoseSign1Message(ReadOnlySpan<byte> contentBytes, Stream? contentStream, Span<byte> buffer, CoseSigner signer, ReadOnlySpan<byte> associatedData, bool isDetached) 747Span<byte> hash = stackalloc byte[hasher.HashLengthInBytes]; 802public override bool TryEncode(Span<byte> destination, out int bytesWritten)
System\Security\Cryptography\Cose\CoseSignature.cs (1)
455Span<byte> hash = stackalloc byte[hasher.HashLengthInBytes];
System.Text.Encoding.CodePages (2)
System\Text\BaseCodePageEncoding.netcoreapp.cs (2)
14private static unsafe void ReadCodePageIndex(Stream stream, Span<byte> codePageIndex) 53Span<byte> pCodePageIndex = new Span<byte>(&codePageIndex, sizeof(CodePageIndex));
System.Text.Encodings.Web (56)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (1)
69Span<uint> thisAllowedCharactersBitmap = new Span<uint>(pBitmap, BitmapLengthInDWords);
System\Text\Encodings\Web\DefaultHtmlEncoder.cs (6)
35private protected override OperationStatus EncodeCore(ReadOnlySpan<char> source, Span<char> destination, out int charsConsumed, out int charsWritten, bool isFinalBlock) 38private protected override OperationStatus EncodeUtf8Core(ReadOnlySpan<byte> utf8Source, Span<byte> utf8Destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) 67internal override int EncodeUtf8(Rune value, Span<byte> destination) 99static int TryEncodeScalarAsHex(object @this, uint scalarValue, Span<byte> destination) 133internal override int EncodeUtf16(Rune value, Span<char> destination) 165static int TryEncodeScalarAsHex(object @this, uint scalarValue, Span<char> destination)
System\Text\Encodings\Web\DefaultJavaScriptEncoder.cs (6)
47private protected override OperationStatus EncodeCore(ReadOnlySpan<char> source, Span<char> destination, out int charsConsumed, out int charsWritten, bool isFinalBlock) 50private protected override OperationStatus EncodeUtf8Core(ReadOnlySpan<byte> utf8Source, Span<byte> utf8Destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) 113internal override int EncodeUtf8(Rune value, Span<byte> destination) 129static int TryEncodeScalarAsHex(object @this, Rune value, Span<byte> destination) 164internal override int EncodeUtf16(Rune value, Span<char> destination) 180static int TryEncodeScalarAsHex(object @this, Rune value, Span<char> destination)
System\Text\Encodings\Web\DefaultUrlEncoder.cs (4)
110private protected override OperationStatus EncodeCore(ReadOnlySpan<char> source, Span<char> destination, out int charsConsumed, out int charsWritten, bool isFinalBlock) 113private protected override OperationStatus EncodeUtf8Core(ReadOnlySpan<byte> utf8Source, Span<byte> utf8Destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock) 142internal override int EncodeUtf8(Rune value, Span<byte> destination) 171internal override int EncodeUtf16(Rune value, Span<char> destination)
System\Text\Encodings\Web\OptimizedInboxTextEncoder.Ascii.cs (1)
90Span<char> tempBuffer = stackalloc char[8] { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' };
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (3)
86Span<char> destination = new Span<char>(buffer, bufferLength); 117public OperationStatus Encode(ReadOnlySpan<char> source, Span<char> destination, out int charsConsumed, out int charsWritten, bool isFinalBlock) 236public OperationStatus EncodeUtf8(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten, bool isFinalBlock)
System\Text\Encodings\Web\ScalarEscaperBase.cs (2)
11internal abstract int EncodeUtf16(Rune value, Span<char> destination); 12internal abstract int EncodeUtf8(Rune value, Span<byte> destination);
System\Text\Encodings\Web\SpanUtility.cs (8)
22public static bool IsValidIndex<T>(Span<T> span, int index) 35public static bool TryWriteBytes(Span<byte> span, byte a, byte b, byte c, byte d) 65public static bool TryWriteBytes(Span<byte> span, byte a, byte b, byte c, byte d, byte e) 97public static bool TryWriteBytes(Span<byte> span, byte a, byte b, byte c, byte d, byte e, byte f) 132public static bool TryWriteChars(Span<char> span, char a, char b, char c, char d) 162public static bool TryWriteChars(Span<char> span, char a, char b, char c, char d, char e) 194public static bool TryWriteChars(Span<char> span, char a, char b, char c, char d, char e, char f) 226public static bool TryWriteUInt64LittleEndian(Span<byte> span, int offset, ulong value)
System\Text\Encodings\Web\TextEncoder.cs (12)
42private unsafe bool TryEncodeUnicodeScalar(uint unicodeScalar, Span<char> buffer, out int charsWritten) 50private bool TryEncodeUnicodeScalarUtf8(uint unicodeScalar, Span<char> utf16ScratchBuffer, Span<byte> utf8Destination, out int bytesWritten) 166Span<char> destBuffer = stringBuilder.AppendSpan(Math.Max(remainingInput.Length, minBufferBumpEachIteration)); 279Span<byte> utf8Destination, 324Span<byte> utf8Destination, 333Span<char> utf16ScratchBuffer = stackalloc char[TempUtf16CharBufferLength]; 409Span<char> destination, 452private protected virtual OperationStatus EncodeCore(ReadOnlySpan<char> source, Span<char> destination, out int charsConsumed, out int charsWritten, bool isFinalBlock) 522Span<char> scratchBuffer = rentedArray; 576internal static bool TryCopyCharacters(string source, Span<char> destination, out int numberOfCharactersWritten) 596internal static bool TryWriteScalarAsChar(int unicodeScalar, Span<char> destination, out int numberOfCharactersWritten)
System.Text.Json (256)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (2)
144public Span<byte> GetSpan(int sizeHint = MinimumBufferSize) 211Span<byte> oldBufferAsSpan = oldBuffer.AsSpan(0, _index);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
src\libraries\System.Text.Json\Common\JsonCamelCaseNamingPolicy.cs (1)
28private static void FixCasing(Span<char> chars)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
59Span<T> span = CollectionsMarshal.AsSpan(items); 64Span<(TKey, int)> keys = span.Length <= StackallocThreshold
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
41Span<char> destination = initialBufferLength <= JsonConstants.StackallocCharThreshold 147void WriteChar(char value, ref Span<char> destination) 157void ExpandBuffer(ref Span<char> destination)
System\Text\Json\Document\JsonDocument.cs (1)
293Span<byte> otherUtf8Text = length <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\Document\JsonDocument.MetadataDb.cs (5)
278Span<byte> destination = _data.AsSpan(index + SizeOrLengthOffset); 287Span<byte> dataPos = _data.AsSpan(index + NumberOfRowsOffset); 300Span<byte> dataPos = _data.AsSpan(index + SizeOrLengthOffset); 315Span<byte> data = _data.AsSpan(0, Length); 384Span<int> newDbInts = MemoryMarshal.Cast<byte, int>(newDatabase);
System\Text\Json\Document\JsonDocument.Parse.cs (1)
628Span<byte> rentedSpan = rented.AsSpan(0, length);
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (4)
32Span<byte> utf8Name = stackalloc byte[JsonConstants.StackallocByteThreshold]; 78Span<byte> utf8Name = default; 142Span<byte> utf8UnescapedStack = stackalloc byte[JsonConstants.StackallocByteThreshold]; 187Span<byte> utf8Unescaped = remaining <= utf8UnescapedStack.Length ?
System\Text\Json\JsonEncodedText.cs (1)
86Span<byte> utf8Bytes = expectedByteCount <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\JsonHelpers.Escaping.cs (2)
40Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 68Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\Nodes\JsonArray.cs (1)
250Span<char> chars = stackalloc char[JsonConstants.MaximumFormatUInt32Length];
System\Text\Json\Reader\JsonReaderHelper.cs (3)
85Span<byte> sourceUnescaped = stackalloc byte[JsonConstants.MaximumEscapedDateTimeOffsetParseLength]; 107Span<byte> sourceUnescaped = stackalloc byte[JsonConstants.MaximumEscapedDateTimeOffsetParseLength]; 130Span<byte> utf8Unescaped = stackalloc byte[JsonConstants.MaximumEscapedGuidLength];
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (14)
18Span<byte> utf8Unescaped = utf8Source.Length <= JsonConstants.StackallocByteThreshold ? 48Span<byte> utf8Unescaped = length <= JsonConstants.StackallocByteThreshold ? 75Span<byte> utf8Unescaped = length <= JsonConstants.StackallocByteThreshold ? 100Span<byte> utf8Unescaped = utf8Source.Length <= JsonConstants.StackallocByteThreshold ? 131Span<byte> utf8Unescaped = length <= JsonConstants.StackallocByteThreshold ? 135Span<byte> utf8Escaped = length <= JsonConstants.StackallocByteThreshold ? 162public static bool TryDecodeBase64InPlace(Span<byte> utf8Unescaped, [NotNullWhen(true)] out byte[]? bytes) 178Span<byte> byteSpan = utf8Unescaped.Length <= JsonConstants.StackallocByteThreshold ? 240public static int TranscodeHelper(ReadOnlySpan<byte> utf8Unescaped, Span<char> destination) 347internal static int GetUtf8FromText(ReadOnlySpan<char> text, Span<byte> dest) 400internal static void Unescape(ReadOnlySpan<byte> source, Span<byte> destination, out int written) 411internal static void Unescape(ReadOnlySpan<byte> source, Span<byte> destination, int idx, out int written) 424internal static bool TryUnescape(ReadOnlySpan<byte> source, Span<byte> destination, out int written) 435private static bool TryUnescape(ReadOnlySpan<byte> source, Span<byte> destination, int idx, out int written)
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (1)
546Span<byte> readSoFar = stackalloc byte[JsonConstants.MaximumLiteralLength];
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (11)
69public readonly int CopyString(Span<byte> utf8Destination) 79internal readonly int CopyValue(Span<byte> utf8Destination) 133public readonly int CopyString(Span<char> destination) 143internal readonly int CopyValue(Span<char> destination) 156Span<byte> unescapedBuffer = valueLength <= JsonConstants.StackallocByteThreshold ? 171Span<byte> intermediate = valueLength <= JsonConstants.StackallocByteThreshold ? 195private readonly bool TryCopyEscapedString(Span<byte> destination, out int bytesWritten) 208Span<byte> intermediate = sequenceLength <= JsonConstants.StackallocByteThreshold ? 1257Span<byte> stackSpan = stackalloc byte[JsonConstants.MaximumEscapedDateTimeOffsetParseLength]; 1322Span<byte> stackSpan = stackalloc byte[JsonConstants.MaximumEscapedDateTimeOffsetParseLength]; 1388Span<byte> stackSpan = stackalloc byte[JsonConstants.MaximumEscapedGuidLength];
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (1)
25Span<char> buffer = stackalloc char[MaxEscapedCharacterLength];
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (3)
45Span<byte> stackSpan = stackalloc byte[MaxEscapedFormatLength]; 61Span<byte> buffer = stackalloc byte[FormatLength]; 73Span<byte> buffer = stackalloc byte[FormatLength];
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
376Span<char> charBuffer = bufferLength <= JsonConstants.StackallocCharThreshold
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (6)
41Span<byte> byteBuffer = bufferLength <= JsonConstants.StackallocByteThreshold 66Span<byte> buffer = stackalloc byte[MaxFormatLength]; 83Span<byte> buffer = stackalloc byte[MaxFormatLength]; 124Span<byte> buffer = stackalloc byte[MaxFormatLength + 2]; 148Span<byte> buffer = stackalloc byte[MaxFormatLength]; 207Span<byte> destination,
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (5)
40Span<byte> buffer = bufferLength <= JsonConstants.StackallocByteThreshold 71Span<byte> buffer = stackalloc byte[MaxFormatLength]; 88Span<byte> buffer = stackalloc byte[MaxFormatLength]; 113Span<byte> buffer = stackalloc byte[MaxFormatLength + 2]; 145Span<byte> destination,
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (3)
47Span<byte> stackSpan = stackalloc byte[MaximumEscapedTimeOnlyFormatLength]; 79Span<byte> output = stackalloc byte[MaximumTimeOnlyFormatLength]; 89Span<byte> output = stackalloc byte[MaximumTimeOnlyFormatLength];
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (3)
47Span<byte> stackSpan = stackalloc byte[MaximumEscapedTimeSpanFormatLength]; 77Span<byte> output = stackalloc byte[MaximumTimeSpanFormatLength]; 87Span<byte> output = stackalloc byte[MaximumTimeSpanFormatLength];
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (5)
40Span<byte> buffer = bufferLength <= JsonConstants.StackallocByteThreshold 70Span<byte> buffer = stackalloc byte[MaxFormatLength]; 87Span<byte> buffer = stackalloc byte[MaxFormatLength]; 112Span<byte> buffer = stackalloc byte[MaxFormatLength + 2]; 144Span<byte> destination,
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (3)
43Span<char> charBuffer = stackalloc char[MaximumEscapedVersionLength]; 89Span<byte> span = stackalloc byte[MaximumVersionLength]; 115Span<byte> span = stackalloc byte[MaximumVersionLength];
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
432Span<byte> utf8 = 463Span<byte> utf8 =
System\Text\Json\Writer\JsonWriterHelper.cs (2)
13public static void WriteIndentation(Span<byte> buffer, int indent, byte indentByte) 287internal static unsafe OperationStatus ToUtf8(ReadOnlySpan<char> source, Span<byte> destination, out int written)
System\Text\Json\Writer\JsonWriterHelper.Date.cs (5)
15public static void WriteDateTimeTrimmed(Span<byte> buffer, DateTime value, out int bytesWritten) 17Span<byte> tempSpan = stackalloc byte[JsonConstants.MaximumFormatDateTimeOffsetLength]; 24public static void WriteDateTimeOffsetTrimmed(Span<byte> buffer, DateTimeOffset value, out int bytesWritten) 26Span<byte> tempSpan = stackalloc byte[JsonConstants.MaximumFormatDateTimeOffsetLength]; 43public static void TrimDateTimeOffset(Span<byte> buffer, out int bytesWritten)
System\Text\Json\Writer\JsonWriterHelper.Escaping.cs (6)
82private static void EscapeString(ReadOnlySpan<byte> value, Span<byte> destination, JavaScriptEncoder encoder, ref int written) 101public static void EscapeString(ReadOnlySpan<byte> value, Span<byte> destination, int indexOfFirstByteToEscape, JavaScriptEncoder? encoder, out int written) 147private static void EscapeNextBytes(byte value, Span<byte> destination, ref int written) 193private static void EscapeString(ReadOnlySpan<char> value, Span<char> destination, JavaScriptEncoder encoder, ref int written) 212public static void EscapeString(ReadOnlySpan<char> value, Span<char> destination, int indexOfFirstByteToEscape, JavaScriptEncoder? encoder, out int written) 258private static void EscapeNextChars(char value, Span<char> destination, ref int written)
System\Text\Json\Writer\Utf8JsonWriter.cs (8)
505Span<byte> output = _memory.Span; 571Span<byte> output = _memory.Span; 717Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 872Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 936Span<byte> output = _memory.Span; 1015Span<byte> output = _memory.Span; 1027private void WriteNewLine(Span<byte> output) 1038private void WriteIndentation(Span<byte> buffer, int indent)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (6)
146Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 169Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 224Span<byte> output = _memory.Span; 259Span<byte> output = _memory.Span; 298Span<byte> output = _memory.Span; 348Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (7)
153Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 176Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 229Span<byte> output = _memory.Span; 262Span<byte> output = _memory.Span; 300Span<byte> output = _memory.Span; 348Span<byte> output = _memory.Span; 384Span<byte> buffer = stackalloc byte[JsonConstants.MaximumFormatDateTimeOffsetLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (7)
152Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 175Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 228Span<byte> output = _memory.Span; 261Span<byte> output = _memory.Span; 299Span<byte> output = _memory.Span; 347Span<byte> output = _memory.Span; 383Span<byte> buffer = stackalloc byte[JsonConstants.MaximumFormatDateTimeOffsetLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (7)
152Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 175Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 228Span<byte> output = _memory.Span; 258Span<byte> output = _memory.Span; 293Span<byte> output = _memory.Span; 338Span<byte> output = _memory.Span; 371Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatDecimalLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (7)
156Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 179Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 232Span<byte> output = _memory.Span; 262Span<byte> output = _memory.Span; 297Span<byte> output = _memory.Span; 342Span<byte> output = _memory.Span; 376Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatDoubleLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (7)
156Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 179Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 232Span<byte> output = _memory.Span; 262Span<byte> output = _memory.Span; 297Span<byte> output = _memory.Span; 342Span<byte> output = _memory.Span; 375Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatSingleLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (2)
123Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 146Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (7)
152Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 175Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 228Span<byte> output = _memory.Span; 262Span<byte> output = _memory.Span; 301Span<byte> output = _memory.Span; 350Span<byte> output = _memory.Span; 387Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatGuidLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (5)
73Span<byte> output = _memory.Span; 104Span<byte> output = _memory.Span; 146Span<byte> output = _memory.Span; 177Span<byte> output = _memory.Span; 206private void TranscodeAndWrite(ReadOnlySpan<char> escapedPropertyName, Span<byte> output)
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (8)
274Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 297Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 351Span<byte> output = _memory.Span; 381Span<byte> output = _memory.Span; 414Span<byte> output = _memory.Span; 444Span<byte> output = _memory.Span; 489Span<byte> output = _memory.Span; 521Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatBooleanLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (7)
228Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 251Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 304Span<byte> output = _memory.Span; 334Span<byte> output = _memory.Span; 369Span<byte> output = _memory.Span; 414Span<byte> output = _memory.Span; 450Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatInt64Length];
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (17)
173Span<byte> output = _memory.Span; 204Span<byte> output = _memory.Span; 333Span<byte> output = _memory.Span; 362Span<byte> output = _memory.Span; 391Span<byte> output = _memory.Span; 918Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ? 941Span<char> escapedValue = length <= JsonConstants.StackallocCharThreshold ? 964Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 987Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 1384Span<byte> output = _memory.Span; 1418Span<byte> output = _memory.Span; 1455Span<byte> output = _memory.Span; 1491Span<byte> output = _memory.Span; 1530Span<byte> output = _memory.Span; 1579Span<byte> output = _memory.Span; 1631Span<byte> output = _memory.Span; 1682Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (7)
237Span<char> escapedPropertyName = length <= JsonConstants.StackallocCharThreshold ? 260Span<byte> escapedPropertyName = length <= JsonConstants.StackallocByteThreshold ? 313Span<byte> output = _memory.Span; 343Span<byte> output = _memory.Span; 378Span<byte> output = _memory.Span; 423Span<byte> output = _memory.Span; 459Span<byte> utf8PropertyName = stackalloc byte[JsonConstants.MaximumFormatUInt64Length];
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (2)
74Span<byte> output = _memory.Span; 114Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (4)
87Span<byte> output = _memory.Span; 121Span<byte> output = _memory.Span; 200Span<byte> output = _memory.Span; 227Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (2)
51Span<byte> output = _memory.Span; 79Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (2)
52Span<byte> output = _memory.Span; 80Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (3)
51Span<byte> output = _memory.Span; 75Span<byte> output = _memory.Span; 99Span<byte> utf8Number = stackalloc byte[JsonConstants.MaximumFormatDecimalLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (4)
55Span<byte> output = _memory.Span; 79Span<byte> output = _memory.Span; 101private static bool TryFormatDouble(double value, Span<byte> destination, out int bytesWritten) 147Span<byte> utf8Number = stackalloc byte[JsonConstants.MaximumFormatDoubleLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (4)
55Span<byte> output = _memory.Span; 79Span<byte> output = _memory.Span; 101private static bool TryFormatSingle(float value, Span<byte> destination, out int bytesWritten) 147Span<byte> utf8Number = stackalloc byte[JsonConstants.MaximumFormatSingleLength];
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (2)
56Span<byte> output = _memory.Span; 81Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (2)
51Span<byte> output = _memory.Span; 80Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (2)
38private void Base64EncodeAndWrite(ReadOnlySpan<byte> bytes, Span<byte> output) 40Span<byte> destination = output.Slice(BytesPending);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (2)
75Span<byte> output = _memory.Span; 99Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (3)
183Span<byte> output = _memory.Span; 206Span<byte> utf8Json = 271Span<byte> output = _memory.Span;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (3)
64Span<byte> output = _memory.Span; 88Span<byte> output = _memory.Span; 112Span<byte> utf8Number = stackalloc byte[JsonConstants.MaximumFormatInt64Length];
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (6)
129Span<byte> output = _memory.Span; 159Span<byte> output = _memory.Span; 192Span<char> escapedValue = length <= JsonConstants.StackallocCharThreshold ? 275Span<byte> output = _memory.Span; 305Span<byte> output = _memory.Span; 339Span<byte> escapedValue = length <= JsonConstants.StackallocByteThreshold ?
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (3)
66Span<byte> output = _memory.Span; 90Span<byte> output = _memory.Span; 114Span<byte> utf8Number = stackalloc byte[JsonConstants.MaximumFormatUInt64Length];
System.Text.Json.SourceGeneration (20)
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithMetadataName.cs (2)
126using var result = new ValueListBuilder<T>(Span<T>.Empty); 163var result = new ValueListBuilder<AttributeData>(Span<AttributeData>.Empty);
src\libraries\Common\src\Roslyn\SyntaxValueProvider_ForAttributeWithSimpleName.cs (6)
162var globalAliases = new Aliases(Span<(string aliasName, string symbolName)>.Empty); 206var localAliases = new Aliases(Span<(string, string)>.Empty); 212var seenNames = new ValueListBuilder<string>(Span<string>.Empty); 213var results = new ValueListBuilder<SyntaxNode>(Span<SyntaxNode>.Empty); 214var attributeTargets = new ValueListBuilder<SyntaxNode>(Span<SyntaxNode>.Empty); 297var nodeStack = new ValueListBuilder<SyntaxNode>(Span<SyntaxNode>.Empty);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T> initialSpan) 49Span<T> span = _span; 65Span<T> span = _span; 104public Span<T> AppendSpan(int length) 109Span<T> span = _span; 122private Span<T> AppendSpanWithGrow(int length) 146public bool TryCopyTo(Span<T> destination, out int itemsWritten)
src\libraries\System.Text.Json\Common\JsonCamelCaseNamingPolicy.cs (1)
28private static void FixCasing(Span<char> chars)
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
41Span<char> destination = initialBufferLength <= JsonConstants.StackallocCharThreshold 147void WriteChar(char value, ref Span<char> destination) 157void ExpandBuffer(ref Span<char> destination)
System.Text.RegularExpressions (51)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T> initialSpan) 49Span<T> span = _span; 65Span<T> span = _span; 104public Span<T> AppendSpan(int length) 109Span<T> span = _span; 122private Span<T> AppendSpanWithGrow(int length) 146public bool TryCopyTo(Span<T> destination, out int itemsWritten)
System\Text\RegularExpressions\Regex.Replace.cs (3)
223Span<ReadOnlyMemory<char>> span = segments.AsSpan(); 234Span<ReadOnlyMemory<char>> span = *(Span<ReadOnlyMemory<char>>*)spanPtr;
System\Text\RegularExpressions\RegexCharClass.cs (6)
646public static bool TryGetOnlyCategories(string set, Span<UnicodeCategory> categories, out int numCategories, out bool negated) 824public static int GetSetChars(string set, Span<char> chars) 1061public static bool SetContainsAsciiOrdinalIgnoreCaseCharacter(string set, Span<char> twoChars) 1638Span<char> headerSpan = vsb.AppendSpan(SetStartIndex); 1876Span<char> scratch = stackalloc char[32]; 1972Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
System\Text\RegularExpressions\RegexFindOptimizations.cs (2)
97Span<char> scratch = stackalloc char[5]; // max efficiently optimized by IndexOfAny today without SearchValues, which isn't used for RTL 307Span<char> scratch = stackalloc char[64];
System\Text\RegularExpressions\RegexNode.cs (3)
1230Span<char> scratchChar = stackalloc char[1]; 1449Span<char> setChars = stackalloc char[128]; 2518Span<char> twoChars = stackalloc char[2];
System\Text\RegularExpressions\RegexParser.cs (1)
55private RegexParser(string pattern, RegexOptions options, CultureInfo culture, Hashtable caps, int capsize, Hashtable? capnames, Span<int> optionSpan)
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (3)
73Span<char> setChars = stackalloc char[MaxPrefixes]; // limit how many chars we get from a set based on the max prefixes we care about 553Span<char> scratch = stackalloc char[128]; 1211Span<char> chars = stackalloc char[5]; // maximum number of chars optimized by IndexOfAny
System\Text\RegularExpressions\RegexReplacement.cs (3)
265Span<int> span = state.offsetAndCounts.AsSpan(); 277Span<int> span = *(Span<int>*)state.Item1;
System\Text\RegularExpressions\RegexWriter.cs (2)
36private RegexWriter(RegexTree tree, Span<int> emittedSpan, Span<int> intStackSpan)
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (2)
379Span<bool> categoryCodes = stackalloc bool[UnicodeCategoryCount]; 477BDD MapCategoryCodeSetToCondition(Span<bool> catCodes)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (2)
111private Span<int> GetDeltasFor(MatchingState<TSet> state) 125private Span<int[]?> GetNfaDeltasFor(MatchingState<TSet> state)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (2)
150Span<int> deltas = matcher.GetDeltasFor(source); 151Span<int[]?> nfaDeltas = matcher.GetNfaDeltasFor(source);
System\Text\StructListBuilder.cs (1)
27public Span<T> AsSpan() => _array.AsSpan(0, _count);
System.Text.RegularExpressions.Generator (42)
RegexGenerator.Emitter.cs (3)
524Span<UnicodeCategory> categories = stackalloc UnicodeCategory[5]; // arbitrary limit to keep names from being too unwieldy 1671Span<char> setChars = stackalloc char[SetCharsSize]; 1750Span<char> setChars = stackalloc char[SetCharsSize]; // needs to be same size as detection check in caller
src\libraries\Common\src\System\HexConverter.cs (6)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 183Span<char> result = bytes.Length > 16 ? 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (8)
16private Span<char> _chars; 19public ValueStringBuilder(Span<char> initialBuffer) 98public Span<char> RawChars => _chars; 118public bool TryCopyTo(Span<char> destination, out int charsWritten) 175Span<char> chars = _chars; 230Span<char> dst = _chars.Slice(_pos, count); 246Span<char> dst = _chars.Slice(_pos, length); 267public Span<char> AppendSpan(int length)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (8)
12private Span<T> _span; 16public ValueListBuilder(Span<T> initialSpan) 49Span<T> span = _span; 65Span<T> span = _span; 104public Span<T> AppendSpan(int length) 109Span<T> span = _span; 122private Span<T> AppendSpanWithGrow(int length) 146public bool TryCopyTo(Span<T> destination, out int itemsWritten)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (6)
646public static bool TryGetOnlyCategories(string set, Span<UnicodeCategory> categories, out int numCategories, out bool negated) 824public static int GetSetChars(string set, Span<char> chars) 1061public static bool SetContainsAsciiOrdinalIgnoreCaseCharacter(string set, Span<char> twoChars) 1638Span<char> headerSpan = vsb.AppendSpan(SetStartIndex); 1876Span<char> scratch = stackalloc char[32]; 1972Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (2)
97Span<char> scratch = stackalloc char[5]; // max efficiently optimized by IndexOfAny today without SearchValues, which isn't used for RTL 307Span<char> scratch = stackalloc char[64];
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (3)
1230Span<char> scratchChar = stackalloc char[1]; 1449Span<char> setChars = stackalloc char[128]; 2518Span<char> twoChars = stackalloc char[2];
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (1)
55private RegexParser(string pattern, RegexOptions options, CultureInfo culture, Hashtable caps, int capsize, Hashtable? capnames, Span<int> optionSpan)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (3)
73Span<char> setChars = stackalloc char[MaxPrefixes]; // limit how many chars we get from a set based on the max prefixes we care about 553Span<char> scratch = stackalloc char[128]; 1211Span<char> chars = stackalloc char[5]; // maximum number of chars optimized by IndexOfAny
Stubs.cs (2)
40Span<char> span = length <= 256 ? stackalloc char[length] : new char[length]; 71internal delegate void SpanAction<T, in TArg>(Span<T> span, TArg arg);
System.Web.HttpUtility (5)
src\libraries\Common\src\System\HexConverter.cs (5)
72public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 82public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper) 163public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper) 230public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed) 330private static bool TryDecodeFromUtf16_Scalar(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)