1841 references to Slice
aspire (5)
src\Shared\CircularBuffer.cs (5)
99data.Slice(0, _end).CopyTo(data.Slice(1)); 107data.Slice(internalIndex, shiftLength).CopyTo(data.Slice(internalIndex + 1)); 110data.Slice(0, _end).CopyTo(data.Slice(1)); 116data.Slice(internalIndex, _end - internalIndex).CopyTo(data.Slice(internalIndex + 1)); 120data.Slice(internalIndex, data.Length - internalIndex - 1).CopyTo(data.Slice(internalIndex + 1));
Aspire.Dashboard (7)
Otlp\Model\OtlpApplication.cs (1)
273instanceId = chars.Slice(0, 8).ToString();
src\Shared\CircularBuffer.cs (5)
99data.Slice(0, _end).CopyTo(data.Slice(1)); 107data.Slice(internalIndex, shiftLength).CopyTo(data.Slice(internalIndex + 1)); 110data.Slice(0, _end).CopyTo(data.Slice(1)); 116data.Slice(internalIndex, _end - internalIndex).CopyTo(data.Slice(internalIndex + 1)); 120data.Slice(internalIndex, data.Length - internalIndex - 1).CopyTo(data.Slice(internalIndex + 1));
src\Shared\CompareHelpers.cs (1)
25(requestPooled = ArrayPool<byte>.Shared.Rent(requestByteCount))).Slice(0, requestByteCount);
Aspire.Hosting (7)
src\Shared\CircularBuffer.cs (5)
99data.Slice(0, _end).CopyTo(data.Slice(1)); 107data.Slice(internalIndex, shiftLength).CopyTo(data.Slice(internalIndex + 1)); 110data.Slice(0, _end).CopyTo(data.Slice(1)); 116data.Slice(internalIndex, _end - internalIndex).CopyTo(data.Slice(internalIndex + 1)); 120data.Slice(internalIndex, data.Length - internalIndex - 1).CopyTo(data.Slice(internalIndex + 1));
src\Shared\CompareHelpers.cs (1)
25(requestPooled = ArrayPool<byte>.Shared.Rent(requestByteCount))).Slice(0, requestByteCount);
Utils\PasswordGenerator.cs (1)
88RandomNumberGenerator.GetItems(choices, destination.Slice(0, minValues));
Aspire.Playground.Tests (1)
src\Aspire.Hosting\Utils\PasswordGenerator.cs (1)
88RandomNumberGenerator.GetItems(choices, destination.Slice(0, minValues));
http2cat (18)
src\Shared\Http2cat\Http2Utilities.cs (15)
204writableBuffer.Write(buffer.Slice(0, length)); 219writableBuffer.Write(buffer.Slice(0, length)); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 306writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 345writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 392writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 510await SendAsync(buffer.Span.Slice(0, length)); 575await SendAsync(buffer.Span.Slice(0, length)); 603await SendAsync(buffer.Span.Slice(0, length));
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
604return span.Slice(0, length).ToArray(); 616return span.Slice(0, length).ToArray(); 632return span.Slice(0, length).ToArray();
IIS.FunctionalTests (18)
src\Shared\Http2cat\Http2Utilities.cs (15)
204writableBuffer.Write(buffer.Slice(0, length)); 219writableBuffer.Write(buffer.Slice(0, length)); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 306writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 345writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 392writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 510await SendAsync(buffer.Span.Slice(0, length)); 575await SendAsync(buffer.Span.Slice(0, length)); 603await SendAsync(buffer.Span.Slice(0, length));
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
604return span.Slice(0, length).ToArray(); 616return span.Slice(0, length).ToArray(); 632return span.Slice(0, length).ToArray();
IIS.LongTests (18)
src\Shared\Http2cat\Http2Utilities.cs (15)
204writableBuffer.Write(buffer.Slice(0, length)); 219writableBuffer.Write(buffer.Slice(0, length)); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 306writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 345writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 392writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 510await SendAsync(buffer.Span.Slice(0, length)); 575await SendAsync(buffer.Span.Slice(0, length)); 603await SendAsync(buffer.Span.Slice(0, length));
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
604return span.Slice(0, length).ToArray(); 616return span.Slice(0, length).ToArray(); 632return span.Slice(0, length).ToArray();
IIS.NewHandler.FunctionalTests (18)
src\Shared\Http2cat\Http2Utilities.cs (15)
204writableBuffer.Write(buffer.Slice(0, length)); 219writableBuffer.Write(buffer.Slice(0, length)); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 306writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 345writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 392writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 510await SendAsync(buffer.Span.Slice(0, length)); 575await SendAsync(buffer.Span.Slice(0, length)); 603await SendAsync(buffer.Span.Slice(0, length));
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
604return span.Slice(0, length).ToArray(); 616return span.Slice(0, length).ToArray(); 632return span.Slice(0, length).ToArray();
IIS.NewShim.FunctionalTests (18)
src\Shared\Http2cat\Http2Utilities.cs (15)
204writableBuffer.Write(buffer.Slice(0, length)); 219writableBuffer.Write(buffer.Slice(0, length)); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 306writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 345writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 392writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 510await SendAsync(buffer.Span.Slice(0, length)); 575await SendAsync(buffer.Span.Slice(0, length)); 603await SendAsync(buffer.Span.Slice(0, length));
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
604return span.Slice(0, length).ToArray(); 616return span.Slice(0, length).ToArray(); 632return span.Slice(0, length).ToArray();
IISExpress.FunctionalTests (18)
src\Shared\Http2cat\Http2Utilities.cs (15)
204writableBuffer.Write(buffer.Slice(0, length)); 219writableBuffer.Write(buffer.Slice(0, length)); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 306writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 345writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 392writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 510await SendAsync(buffer.Span.Slice(0, length)); 575await SendAsync(buffer.Span.Slice(0, length)); 603await SendAsync(buffer.Span.Slice(0, length));
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
604return span.Slice(0, length).ToArray(); 616return span.Slice(0, length).ToArray(); 632return span.Slice(0, length).ToArray();
illink (12)
InMemory.FunctionalTests (15)
Http2\Http2TestBase.cs (13)
661var extendedHeader = buffer.Slice(0, extendedHeaderLength); 663var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 666var padding = buffer.Slice(extendedHeaderLength + length, padLength); 677writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 703var extendedHeader = buffer.Slice(0, extendedHeaderLength); 718writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 749var extendedHeader = buffer.Slice(0, extendedHeaderLength); 753var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 756var padding = buffer.Slice(extendedHeaderLength + length, padLength); 767writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 878await SendAsync(buffer.Span.Slice(0, length)); 948await SendAsync(buffer.Span.Slice(0, length)); 976await SendAsync(buffer.Span.Slice(0, length));
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (2)
51writer.Write(buffer.Slice(0, length)); 66writer.Write(buffer.Slice(0, length));
Microsoft.AspNetCore.Components (4)
src\Shared\UrlDecoder\UrlDecoder.cs (2)
29return DecodeInPlace(destination.Slice(0, source.Length), isFormEncoding); 363return DecodeInPlace(destination.Slice(0, source.Length));
SupplyParameterFromPersistentComponentStateValueProvider.cs (2)
143currentBuffer = keyBuffer[preKey.Length..]; 163currentBuffer = keyBuffer[preKey.Length..];
Microsoft.AspNetCore.Components.Endpoints (1)
FormMapping\FormDataReader.cs (1)
237separator.CopyTo(_prefixBuffer.Span[_currentPrefixBuffer.Length..]);
Microsoft.AspNetCore.Components.Forms (4)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (4)
45span.CopyTo(_currentBuffer[startIndex..]); 64_currentBuffer[_nextEndIndex..].CopyTo(newBuffer.AsSpan(newEndIndex)); 86span.CopyTo(_currentBuffer[startIndex..]); 112? new(_currentBuffer[_nextEndIndex..])
Microsoft.AspNetCore.Components.QuickGrid (1)
Columns\GridSort.cs (1)
176body.Member.Name.CopyTo(chars[nextPos..]);
Microsoft.AspNetCore.Components.Server (2)
BlazorPack\SequenceOfT.cs (1)
443this.AvailableMemory.Span.Slice(startIndex, length).Clear();
src\SignalR\common\Shared\BinaryMessageFormatter.cs (1)
17output.Write(lenBuffer.Slice(0, lenNumBytes));
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\RenderBatchWriterTest.cs (1)
356=> BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(startOffset, 4));
Microsoft.AspNetCore.Components.Web (4)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (4)
45span.CopyTo(_currentBuffer[startIndex..]); 64_currentBuffer[_nextEndIndex..].CopyTo(newBuffer.AsSpan(newEndIndex)); 86span.CopyTo(_currentBuffer[startIndex..]); 112? new(_currentBuffer[_nextEndIndex..])
Microsoft.AspNetCore.DataProtection (19)
Managed\ManagedAuthenticatedEncryptor.cs (13)
199? stackalloc byte[256].Slice(0, _keyDerivationKey.Length) 207? stackalloc byte[128].Slice(0, _validationAlgorithmSubkeyLengthInBytes) 213? stackalloc byte[128].Slice(0, _symmetricAlgorithmSubkeyLengthInBytes) 310? stackalloc byte[256].Slice(0, _keyDerivationKey.Length) 319? stackalloc byte[128].Slice(0, _validationAlgorithmSubkeyLengthInBytes) 328? stackalloc byte[128].Slice(0, _symmetricAlgorithmSubkeyLengthInBytes) 342? stackalloc byte[128].Slice(0, keyModifierLength) 387keyModifier.CopyTo(outputSpan.Slice(start: 0, length: keyModifierLength)); 391var iv = outputSpan.Slice(start: keyModifierLength, length: ivLength); 405symmetricAlgorithm.EncryptCbc(plainTextSpan, iv, outputSpan.Slice(start: keyModifierLength + ivLength, length: cipherTextLength)); 413var ivAndCipherTextSpan = outputSpan.Slice(start: keyModifierLength, length: ivLength + cipherTextLength); 414var macDestinationSpan = outputSpan.Slice(keyModifierLength + ivLength + cipherTextLength, macLength); 492? stackalloc byte[128].Slice(0, hashSize)
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (6)
64? stackalloc byte[128].Slice(0, prfOutputSizeInBytes) 74? stackalloc byte[128].Slice(0, prfInputLength) 121var destination = operationSubkey.Slice(operationSubKeyIndex, bytesToWrite); 122prfOutput.Slice(0, bytesToWrite).CopyTo(destination); 128var destination = validationSubkey.Slice(validationSubKeyIndex, leftOverBytes); 129prfOutput.Slice(bytesToWrite, leftOverBytes).CopyTo(destination);
Microsoft.AspNetCore.Http.Abstractions (6)
PathString.cs (3)
189var length = UrlDecoder.DecodeInPlace(pathBuffer.Slice(position, uriComponent.Length - position)); 190pathBuffer = pathBuffer.Slice(0, position + length); 206pathBuffer = pathBuffer.Slice(0, length + 1);
src\Shared\UrlDecoder\UrlDecoder.cs (2)
29return DecodeInPlace(destination.Slice(0, source.Length), isFormEncoding); 363return DecodeInPlace(destination.Slice(0, source.Length));
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
54public ReadOnlySpan<T> AsSpan() => _span.Slice(0, _pos);
Microsoft.AspNetCore.Http.Connections.Common (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
144return _memory.Span.Slice(_memoryUsed, _memory.Length - _memoryUsed);
Microsoft.AspNetCore.Http.Extensions (16)
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (1)
237separator.CopyTo(_prefixBuffer.Span[_currentPrefixBuffer.Length..]);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
54public ReadOnlySpan<T> AsSpan() => _span.Slice(0, _pos);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (13)
93string s = _chars.Slice(0, _pos).ToString(); 112return _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 116public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 117public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 121if (_chars.Slice(0, _pos).TryCopyTo(destination)) 143_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 144_chars.Slice(index, count).Fill(value); 163_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 268return _chars.Slice(origPos, length); 295_chars.Slice(0, _pos).CopyTo(poolArray);
UriHelper.cs (1)
219text.CopyTo(buffer.Slice(index, text.Length));
Microsoft.AspNetCore.HttpLogging (14)
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
54public ReadOnlySpan<T> AsSpan() => _span.Slice(0, _pos);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (13)
93string s = _chars.Slice(0, _pos).ToString(); 112return _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 116public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 117public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 121if (_chars.Slice(0, _pos).TryCopyTo(destination)) 143_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 144_chars.Slice(index, count).Fill(value); 163_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 268return _chars.Slice(origPos, length); 295_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.AspNetCore.OpenApi (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
144return _memory.Span.Slice(_memoryUsed, _memory.Length - _memoryUsed);
Microsoft.AspNetCore.Routing (5)
Matching\DfaMatcher.cs (1)
47var segments = buffer.Slice(0, count);
Matching\DfaMatcherBuilder.cs (1)
429(stackalloc bool[32]).Slice(0, parent.Literals.Keys.Count) :
Matching\ILEmitTrieFactory.cs (3)
168EmitIfLadder(groups[mid..]); 383EmitIfLadder(groups[mid..]); 515EmitIfLadder(groups[mid..]);
Microsoft.AspNetCore.Routing.Tests (8)
Matching\DfaMatcherTest.cs (8)
372var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 399var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 426var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 453var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 478var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 504var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 531var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count)); 558var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count));
Microsoft.AspNetCore.Server.HttpSys (10)
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (1)
65return raw.Slice(pathStartIndex, scan - pathStartIndex);
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (2)
42return UTF8.GetString(unescapedPath.Slice(0, length)); 92return rawPath.Slice(0, writer);
src\Shared\PathNormalizer\PathNormalizer.cs (7)
26var currentSrc = src[readPointer..]; 35currentSrc.CopyTo(src[writtenLength..]); 42currentSrc[..nextDotSegmentIndex].CopyTo(src[writtenLength..]); 74src.Slice(readPointer, 3).CopyTo(src[writtenLength..]); 110src[readPointer..].CopyTo(src[writtenLength..]);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (18)
src\Shared\Http2cat\Http2Utilities.cs (15)
204writableBuffer.Write(buffer.Slice(0, length)); 219writableBuffer.Write(buffer.Slice(0, length)); 290var extendedHeader = buffer.Slice(0, extendedHeaderLength); 292var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 295var padding = buffer.Slice(extendedHeaderLength + length, padLength); 306writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 330var extendedHeader = buffer.Slice(0, extendedHeaderLength); 345writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 374var extendedHeader = buffer.Slice(0, extendedHeaderLength); 378var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 381var padding = buffer.Slice(extendedHeaderLength + length, padLength); 392writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 510await SendAsync(buffer.Span.Slice(0, length)); 575await SendAsync(buffer.Span.Slice(0, length)); 603await SendAsync(buffer.Span.Slice(0, length));
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
604return span.Slice(0, length).ToArray(); 616return span.Slice(0, length).ToArray(); 632return span.Slice(0, length).ToArray();
Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks (5)
RequestHeaderBenchmarks.cs (5)
72var dataDestination = nativeMemory[Marshal.SizeOf<HTTP_REQUEST_V1>()..]; 87var unknownHeaderStructureDestination = nativeMemory[Marshal.SizeOf<HTTP_REQUEST_V1>()..]; 105dataDestination = dataDestination[nameLength..]; 115dataDestination = dataDestination[nameLength..]; 118unknownHeaderStructureDestination = unknownHeaderStructureDestination[unknownHeadersSize..];
Microsoft.AspNetCore.Server.IIS (10)
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (1)
65return raw.Slice(pathStartIndex, scan - pathStartIndex);
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (2)
42return UTF8.GetString(unescapedPath.Slice(0, length)); 92return rawPath.Slice(0, writer);
src\Shared\PathNormalizer\PathNormalizer.cs (7)
26var currentSrc = src[readPointer..]; 35currentSrc.CopyTo(src[writtenLength..]); 42currentSrc[..nextDotSegmentIndex].CopyTo(src[writtenLength..]); 74src.Slice(readPointer, 3).CopyTo(src[writtenLength..]); 110src[readPointer..].CopyTo(src[writtenLength..]);
Microsoft.AspNetCore.Server.Kestrel.Core (34)
Internal\Http\Http1Connection.cs (4)
297var target = startLine[targetStart..]; 312else if (startLine[targetStart..].GetKnownHttpScheme(out _)) 433var query = target[targetPath.Length..]; 525Span<byte> query = target[targetPath.Length..];
Internal\Http\Http1OutputProducer.cs (1)
806public ReadOnlySpan<byte> Span => Buffer.Span.Slice(0, Length);
Internal\Http\HttpParser.cs (2)
431headerSpan = headerSpan.Slice(0, headerLength); 448if (terminatorSize == -1 || !TryTakeSingleHeader(handler, headerSpan.Slice(0, headerSpan.Length - terminatorSize)))
Internal\Http\HttpRequestHeaders.cs (1)
126!long.TryParse(decodedChars.Slice(0, numChars), NumberStyles.Integer, CultureInfo.InvariantCulture, out parsed) ||
Internal\Http\PathDecoder.cs (3)
31pathLength = PathNormalizer.RemoveDotSegments(path.Slice(0, pathLength)); 33return Encoding.UTF8.GetString(path.Slice(0, pathLength)); 45return path.Slice(0, pathLength).GetAsciiString();
Internal\Http2\Http2FrameWriter.cs (1)
916var buffer = _outputWriter.GetSpan(settingsSize).Slice(0, settingsSize); // GetSpan isn't precise
Internal\Http2\Http2Stream.cs (1)
437? stackalloc byte[MaxPathBufferStackAllocSize].Slice(0, pathSegment.Length)
Internal\Http3\Http3Stream.cs (1)
1178? stackalloc byte[MaxPathBufferStackAllocSize].Slice(0, pathSegment.Length)
Middleware\Internal\LoggingStream.cs (3)
91Log("Read", destination.Slice(0, read)); 111Log("ReadAsync", destination.Span.Slice(0, read)); 221builder.Append(charBuilder.Slice(0, charBuilderIndex));
src\Shared\PathNormalizer\PathNormalizer.cs (7)
26var currentSrc = src[readPointer..]; 35currentSrc.CopyTo(src[writtenLength..]); 42currentSrc[..nextDotSegmentIndex].CopyTo(src[writtenLength..]); 74src.Slice(readPointer, 3).CopyTo(src[writtenLength..]); 110src[readPointer..].CopyTo(src[writtenLength..]);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
604return span.Slice(0, length).ToArray(); 616return span.Slice(0, length).ToArray(); 632return span.Slice(0, length).ToArray();
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (5)
44return buffer.Slice(0, bytesWritten).ToArray(); 99return temp.Slice(0, headerBytesWritten).ToArray(); 107return temp.Slice(0, bytesWritten).ToArray(); 169return temp.Slice(0, nameLength).ToArray(); 179return temp.Slice(0, bytesWritten).ToArray();
src\Shared\UrlDecoder\UrlDecoder.cs (2)
29return DecodeInPlace(destination.Slice(0, source.Length), isFormEncoding); 363return DecodeInPlace(destination.Slice(0, source.Length));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (33)
AsciiDecoding.cs (2)
103Assert.False(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, span.Slice(0, span.Length - 1))); 107Assert.False(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, span.Slice(1, span.Length - 1)));
ChunkWriterTests.cs (1)
44Assert.Equal(Encoding.ASCII.GetBytes(expected), span.Slice(0, count).ToArray());
Http2\Http2HPackEncoderTests.cs (16)
27var result = buffer.Slice(0, length).ToArray(); 50var result = buffer.Slice(5, length - 5).ToArray(); 78var result = buffer.Slice(0, length).ToArray(); 120result = buffer.Slice(0, length).ToArray(); 161result = buffer.Slice(0, length).ToArray(); 222var result = buffer.Slice(0, length).ToArray(); 264result = buffer.Slice(0, length).ToArray(); 305result = buffer.Slice(0, length).ToArray(); 542Assert.Equal(HeaderWriteResult.MoreHeaders, HPackHeaderWriter.BeginEncodeHeaders(statusCode, hpackEncoder, headerEnumerator, payload.Slice(offset, sliceLength), out var length)); 544Assert.Equal(expectedStatusCodePayload, payload.Slice(0, length).ToArray()); 549Assert.Equal(HeaderWriteResult.MoreHeaders, HPackHeaderWriter.ContinueEncodeHeaders(hpackEncoder, headerEnumerator, payload.Slice(offset, sliceLength), out length)); 551Assert.Equal(expectedDateHeaderPayload, payload.Slice(offset, length).ToArray()); 556Assert.Equal(HeaderWriteResult.MoreHeaders, HPackHeaderWriter.ContinueEncodeHeaders(hpackEncoder, headerEnumerator, payload.Slice(offset, sliceLength), out length)); 558Assert.Equal(expectedContentTypeHeaderPayload, payload.Slice(offset, length).ToArray()); 563Assert.Equal(HeaderWriteResult.Done, HPackHeaderWriter.ContinueEncodeHeaders(hpackEncoder, headerEnumerator, payload.Slice(offset, sliceLength), out length)); 565Assert.Equal(expectedServerHeaderPayload, payload.Slice(offset, length).ToArray());
Http3\Http3QPackEncoderTests.cs (6)
24var result = buffer.Slice(0, length).ToArray(); 41var result = buffer.Slice(0, length).ToArray(); 90var result = buffer.Slice(2, length - 2).ToArray(); // trim prefix 109var result = buffer.Slice(2, length - 2).ToArray(); // trim prefix 128var result = buffer.Slice(2, length - 2).ToArray(); // trim prefix 147var result = buffer.Slice(2, length - 2).ToArray();
HttpParserTests.cs (2)
931var target = startLine[targetStart..]; 933var query = target[targetPath.Length..];
HttpRequestHeadersTests.cs (2)
545headerValueUtf16Latin1CrossOver = new string(headerValue.AsSpan().Slice(0, i + 1)); 606headerValueUtf16Latin1CrossOver = new string(headerValue.AsSpan().Slice(0, i + 1));
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (2)
51writer.Write(buffer.Slice(0, length)); 66writer.Write(buffer.Slice(0, length));
src\Shared\test\Shared.Tests\runtime\Http2\HPackIntegerTest.cs (1)
21Assert.True(actualResult.Slice(0, bytesWritten).SequenceEqual(expectedResult));
src\Shared\test\Shared.Tests\runtime\Http3\QPackDecoderTest.cs (1)
173TestDecodeWithoutIndexing(buffer.Slice(0, length).ToArray(), new[]
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (2)
51writer.Write(buffer.Slice(0, length)); 66writer.Write(buffer.Slice(0, length));
Microsoft.AspNetCore.Shared.Tests (22)
runtime\Http2\HPackIntegerTest.cs (1)
21Assert.True(actualResult.Slice(0, bytesWritten).SequenceEqual(expectedResult));
runtime\Http3\QPackDecoderTest.cs (1)
173TestDecodeWithoutIndexing(buffer.Slice(0, length).ToArray(), new[]
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (1)
65return raw.Slice(pathStartIndex, scan - pathStartIndex);
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (2)
42return UTF8.GetString(unescapedPath.Slice(0, length)); 92return rawPath.Slice(0, writer);
src\Shared\PathNormalizer\PathNormalizer.cs (7)
26var currentSrc = src[readPointer..]; 35currentSrc.CopyTo(src[writtenLength..]); 42currentSrc[..nextDotSegmentIndex].CopyTo(src[writtenLength..]); 74src.Slice(readPointer, 3).CopyTo(src[writtenLength..]); 110src[readPointer..].CopyTo(src[writtenLength..]);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
604return span.Slice(0, length).ToArray(); 616return span.Slice(0, length).ToArray(); 632return span.Slice(0, length).ToArray();
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (5)
44return buffer.Slice(0, bytesWritten).ToArray(); 99return temp.Slice(0, headerBytesWritten).ToArray(); 107return temp.Slice(0, bytesWritten).ToArray(); 169return temp.Slice(0, nameLength).ToArray(); 179return temp.Slice(0, bytesWritten).ToArray();
src\Shared\UrlDecoder\UrlDecoder.cs (2)
29return DecodeInPlace(destination.Slice(0, source.Length), isFormEncoding); 363return DecodeInPlace(destination.Slice(0, source.Length));
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
774? stackalloc bool[MaxStackSize].Slice(0, args.Length)
Microsoft.AspNetCore.SignalR.Common (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
144return _memory.Span.Slice(_memoryUsed, _memory.Length - _memoryUsed);
Microsoft.AspNetCore.SignalR.Common.Tests (1)
src\SignalR\common\Shared\BinaryMessageFormatter.cs (1)
17output.Write(lenBuffer.Slice(0, lenNumBytes));
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
src\SignalR\common\Shared\BinaryMessageFormatter.cs (1)
17output.Write(lenBuffer.Slice(0, lenNumBytes));
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
144return _memory.Span.Slice(_memoryUsed, _memory.Length - _memoryUsed);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
src\SignalR\common\Shared\BinaryMessageFormatter.cs (1)
17output.Write(lenBuffer.Slice(0, lenNumBytes));
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
144return _memory.Span.Slice(_memoryUsed, _memory.Length - _memoryUsed);
Microsoft.AspNetCore.WebSockets (14)
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
54public ReadOnlySpan<T> AsSpan() => _span.Slice(0, _pos);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (13)
93string s = _chars.Slice(0, _pos).ToString(); 112return _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 116public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 117public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 121if (_chars.Slice(0, _pos).TryCopyTo(destination)) 143_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 144_chars.Slice(index, count).Fill(value); 163_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 268return _chars.Slice(origPos, length); 295_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.AspNetCore.WebUtilities (8)
FileBufferingReadStream.cs (1)
309_buffer.Write(buffer.Slice(0, read));
FormPipeReader.cs (2)
354Span<byte> buffer = stackalloc byte[StackAllocThreshold].Slice(0, (int)ros.Length); 403span = span.Slice(0, bytes);
HttpRequestStreamReader.cs (3)
200buffer = buffer.Slice(charsRemaining, count); 404span = span.Slice(0, index); 434span = span.Slice(0, index);
src\Shared\UrlDecoder\UrlDecoder.cs (2)
29return DecodeInPlace(destination.Slice(0, source.Length), isFormEncoding); 363return DecodeInPlace(destination.Slice(0, source.Length));
Microsoft.Build (4)
FileUtilities.cs (2)
655return str.Slice(0, sliceLength); 668return hasQuotes ? path.Slice(1, endId - 1) : path;
Logging\OptimizedStringIndenter.cs (2)
117segments = segments.Slice(0, 1); 135segments = segments.Slice(0, segmentCount);
Microsoft.Build.Engine.OM.UnitTests (2)
FileUtilities.cs (2)
655return str.Slice(0, sliceLength); 668return hasQuotes ? path.Slice(1, endId - 1) : path;
Microsoft.Build.Framework (8)
ArraySortHelper.cs (8)
758InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 764HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 769int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 772IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 999InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1005HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1010int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1013IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
Microsoft.Build.Tasks.Core (2)
FileUtilities.cs (2)
655return str.Slice(0, sliceLength); 668return hasQuotes ? path.Slice(1, endId - 1) : path;
Microsoft.Build.Utilities.Core (2)
FileUtilities.cs (2)
655return str.Slice(0, sliceLength); 668return hasQuotes ? path.Slice(1, endId - 1) : path;
Microsoft.CodeAnalysis (19)
CommandLine\CommandLineParser.cs (2)
610lineBuffer.Slice(0, lineBufferLength), 628lineBuffer.Slice(0, lineBufferLength),
Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
Syntax\SyntaxTriviaListBuilder.cs (1)
101items.Slice(offset, length).CopyTo(_nodes.AsSpan().Slice(_count, length));
Microsoft.CodeAnalysis.CodeStyle (19)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
141tempBuffer = tempBuffer.Slice(0, charsWritten);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (2)
102var contentHash = bytes[HashIndex..HashSize].ToImmutableArray(); 103var position = BinaryPrimitives.ReadInt32LittleEndian(bytes[PositionIndex..]);
Microsoft.CodeAnalysis.Collections.Package (12)
Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (5)
Symbols\Source\NullablePublicAPITests.cs (5)
3259verifyAnnotation(indexers.Slice(0, 2), PublicNullableAnnotation.Annotated, PublicNullableAnnotation.NotAnnotated); 3260verifyAnnotation(indexers.Slice(2, 2), PublicNullableAnnotation.NotAnnotated, PublicNullableAnnotation.Annotated); 3261verifyAnnotation(indexers.Slice(4, 2), PublicNullableAnnotation.NotAnnotated, PublicNullableAnnotation.NotAnnotated); 3311verifyAnnotation(elementAccesses.Slice(0, 2), PublicNullableAnnotation.Annotated); 3312verifyAnnotation(elementAccesses.Slice(2, 2), PublicNullableAnnotation.NotAnnotated);
Microsoft.CodeAnalysis.InteractiveHost (12)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
Microsoft.CodeAnalysis.Threading.Package (12)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
Microsoft.CodeAnalysis.Workspaces (20)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
141tempBuffer = tempBuffer.Slice(0, charsWritten);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (2)
102var contentHash = bytes[HashIndex..HashSize].ToImmutableArray(); 103var position = BinaryPrimitives.ReadInt32LittleEndian(bytes[PositionIndex..]);
Workspace\Solution\Checksum_Factory.cs (1)
144var hashSpan = checksumsSpan.Slice(0, count);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (12)
src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
Microsoft.CodeAnalysis.Workspaces.UnitTests (5)
ChecksumTests.cs (5)
61AssertEqual(Checksum.Create(builder[0], builder[1]), builder.Slice(0, 2)); 62AssertEqual(Checksum.Create(builder[0], builder[1], builder[2]), builder.Slice(0, 3)); 63AssertEqual(Checksum.Create(builder[0], builder[1], builder[2], builder[3]), builder.Slice(0, 4)); 67var toValidate = builder.Slice(0, i); 92var toValidate = builder.Slice(0, i);
Microsoft.Data.Analysis (5)
DataFrameBuffer.cs (1)
32get => (MemoryMarshal.Cast<byte, T>(Buffer.Span)).Slice(0, Length);
PrimitiveColumnContainer.cs (1)
170mutableLastBuffer.RawSpan.Slice(mutableLastBuffer.Length - allocatable, allocatable).Fill(value.Value);
Utils\BitUtility.cs (3)
119var slice = data.Slice(startByteIndex, 1); 126var slice = data.Slice(fullByteStartIndex, fullByteEndIndex - fullByteStartIndex + 1); 134var slice = data.Slice(endByteIndex, 1);
Microsoft.Extensions.Compliance.Abstractions (4)
Redaction\RedactionStringBuilderExtensions.cs (1)
62return stringBuilder.Append(destination.Slice(0, written));
Redaction\Redactor.cs (3)
122var formatted = buffer.Slice(0, written); 182var formatted = buffer.Slice(0, written); 233var formatted = buffer.Slice(0, written);
Microsoft.Extensions.Compliance.Redaction (2)
HmacRedactor.cs (2)
76return CreateSha256Hash(source, destination[_keyId.Length..], _hashKey) + _keyId.Length; 87_ = Convert.TryToBase64Chars(hashBuffer.Slice(0, BytesOfHashWeUse), destination, out int charsWritten);
Microsoft.Extensions.Compliance.Testing (1)
FakeRedactor.cs (1)
84EventCollector.Append(new RedactedData(sourceString, destination.Slice(0, str.Length).ToString(), order));
Microsoft.Extensions.DependencyInjection.Abstractions (3)
ActivatorUtilities.cs (3)
73Span<object?> ctorArgs = values.Slice(0, maxArgs); 74Span<object?> bestCtorArgs = values.Slice(maxArgs, maxArgs); 879return _constructor.Invoker.Invoke(_parameterValues.Slice(0, _constructor.Parameters.Length));
Microsoft.Extensions.Logging.Abstractions (12)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.Extensions.Logging.Console (1)
SimpleConsoleFormatter.cs (1)
103textWriter.Write(span.Slice(0, charsWritten));
Microsoft.Extensions.Telemetry (3)
Logging\JustInTimeRedactor.cs (3)
102workBuffer.Slice(0, charsInWorkBuffer).CopyTo(a); 149var finalToBeRedacted = workBuffer.Slice(0, charsInWorkBuffer); 159result = t.AsSpan().Slice(0, redactedLen).ToString();
Microsoft.Extensions.Telemetry.Tests (2)
Logging\JustInTimeRedactorTests.cs (2)
47Assert.Equal($"{ShortRedactorPrefix}<{redactorInput}>", d.Slice(0, charsWritten).ToString()); 71Assert.Equal($"{longRedactorPrefix}<{redactorInput}>", d.Slice(0, charsWritten).ToString());
Microsoft.ML.Core (7)
Utilities\Stream.cs (1)
717rentedArray.AsSpan(0, numElementsToReadThisChunk * sizeof(T)).CopyTo(MemoryMarshal.AsBytes(destination.Slice(0, numElementsToReadThisChunk)));
Utilities\VBufferUtils.cs (6)
342editor.Indices.Slice(idx, sliceLength).CopyTo(editor.Indices.Slice(idx + 1)); 343editor.Values.Slice(idx, sliceLength).CopyTo(editor.Values.Slice(idx + 1)); 380editor.Values.Slice(min, indices[ii] - min).Clear(); 383editor.Values.Slice(min, dst.Length - min).Clear(); 433editor.Values.Slice(lim, sliceLength).CopyTo(editor.Values.Slice(denseCount)); 434editor.Indices.Slice(lim, sliceLength).CopyTo(editor.Indices.Slice(denseCount));
Microsoft.ML.CpuMath (5)
CpuMathUtils.cs (5)
75TensorPrimitives.MultiplyAdd(source.Slice(0, count), scale, destination.Slice(0, count), destination); 97TensorPrimitives.MultiplyAdd(source.Slice(0, count), scale, destination.Slice(0, count), result.Slice(0, count)); 115TensorPrimitives.Add(source.Slice(0, count), destination.Slice(0, count), destination.Slice(0, count)); 136TensorPrimitives.Multiply(left.Slice(0, count), right.Slice(0, count), destination.Slice(0, count));
Microsoft.ML.Data (2)
Deprecated\Vector\VBufferMathUtils.cs (2)
309indices.Slice(dLim, dstValues.Length - dLim) 311values.Slice(dLim, dstValues.Length - dLim)
Microsoft.ML.DataView (1)
VBuffer.cs (1)
300destination.Slice(destinationIndex, Length).Clear();
Microsoft.ML.FastTree (1)
FastTree.cs (1)
2524editor.Values.Slice(_dense.Count, length - _dense.Count).Clear();
Microsoft.ML.ImageAnalytics (2)
ImageLoader.cs (2)
343srcSpan = readBufferSpan.Slice(0, bytesRead); 344var dstSpan = bufferSpan.Slice(totalBytesRead, bytesRead);
Microsoft.ML.StandardTrainers (1)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
1245float softmax = MathUtils.SoftMax(dst.Slice(0, NumberOfClasses));
Microsoft.ML.TestFrameworkCommon (1)
TestLogger.cs (1)
49span = span.Slice(0, count - 2);
Microsoft.ML.Tokenizers (69)
Model\BPETokenizer.cs (2)
1052current = utf8bytes.Slice(incompleteUtf8BytesInBufferIndex, incompleteUtf8BytesInBuffer + span.Length); 1066vocabBuffer.Slice(0, completeCharsWritten).CopyTo(buffer);
Model\CodeGenTokenizer.cs (13)
352span = mutatedInputSpan.Slice(0, span.Length + 1); 464List<EncodedToken> result = EncodeToTokens(token.Slice(0, encodedLength), mapping.Slice(0, encodedLength), textSpan, agenda); 609span = mutatedInputSpan.Slice(0, span.Length + 1); 828span = mutatedInputSpan.Slice(0, span.Length + 1); 965span = mutatedInputSpan.Slice(0, span.Length + 1); 1147List<EncodedToken> result = EncodeToTokens(token.Slice(0, encodedLength), mapping.Slice(0, encodedLength), textSpan, agenda); 1211List<EncodedToken> result = EncodeToTokens(token.Slice(0, encodedLength), mapping.Slice(0, encodedLength), textSpan, agenda); 1482current = utf8bytes.Slice(incompleteUtf8BytesInBufferIndex, incompleteUtf8BytesInBuffer + span.Length); 1496vocabBuffer.Slice(0, completeCharsWritten).CopyTo(buffer); 1663if (_vocab.TryGetValue(text.Slice(symbols[index].pieceSpan.Index, symbols[index].pieceSpan.Length), out (int Id, string Token) value))
Model\EnglishRobertaTokenizer.cs (3)
393List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping); 699List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping); 744List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping);
Model\SentencePieceBaseModel.cs (1)
558destination.Slice(suffixIndex + 1, charsWritten - suffixIndex - 1).CopyTo(destination.Slice(suffixIndex));
Model\SentencePieceUnigramModel.cs (13)
256normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 284normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 307int normalizationCount = Normalizer!.Normalize(byteSpan.Slice(0, byteCount), ref normalizationSpan, ref normalizedArrayPool); 308normalizationSpan = normalizationSpan.Slice(0, normalizationCount); 322normalizationSpan = byteSpan.Slice(0, byteCount); 362string stringToken = node.Id == UnknownId ? Helpers.GetString(normalizationSpan.Slice(node.StartsAt, endsAt - node.StartsAt)) : _vocabReverse[node.Id].Piece; 700normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 722normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 887ReadOnlySpan<byte> utf8UnknownBytes = normalizationSpan.Slice(unknownTokensTracking![j].Utf8Index, unknownTokensTracking![j].Utf8Length); 1070normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1092normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1184charsConsumed += Helpers.GetUtf16LengthFromUtf8Bytes(normalizationSpan.Slice(ids[i].UtfStartOffset, ids[i].Utf8Length)); 1395consumedCharacters += Helpers.GetUtf16LengthFromUtf8Bytes(normalizationSpan.Slice(node.StartsAt, length));
Model\TiktokenTokenizer.cs (8)
331(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1)); 448(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1)); 613(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1)); 739(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1)); 829return Helpers.GetString(utf8Bytes.Slice(0, utf8ByteCount)); 922tempBuffer.Slice(0, incompleteCharsWritten).CopyTo(buffer); 945if (!Helpers.ConvertUtf8ToUtf16(utf8Bytes.Slice(utf8BytesIncompleteIndex, utf8BytesIncompleteCount + tokenBytes.Length), tempBuffer, out int bytesConsumed, out int charsConsumed)) 955tempBuffer.Slice(0, charsConsumed).CopyTo(buffer);
Normalizer\BertNormalizer.cs (1)
88AddSpan(ref buffer, ref index, casingBuffer.Slice(0, length));
Normalizer\SentencePieceNormalizer.cs (4)
141span = span.Slice(0, spanLength); 192string result = span.Slice(0, bufferIndex).ToString(); 248if (currentIndex >= tokenLength - 1 && span.Slice(currentIndex - tokenLength + 1, tokenLength).SequenceEqual(token.AsSpan())) 441while (normalized.Slice(0, normalizedIndex).EndsWith(space))
Utils\BytePairEncoder.cs (2)
28byteIndicesAndRanks = byteIndicesAndRanks.Slice(0, requiredLength); 79byteIndicesAndRanks = byteIndicesAndRanks.Slice(0, byteIndicesAndRanks.Length - 1);
Utils\Helpers.netcoreapp.cs (1)
92buffer.Slice(0, bytesWritten).CopyTo(destination.AsSpan(bytesIndex));
Utils\OrdinalUtf8StringComparer.cs (2)
76int result = buffer1.Slice(0, xLen).SequenceCompareTo(buffer2.Slice(0, yLen));
Utils\ValueStringBuilder.cs (19)
95Span<char> span = _chars.Slice(0, _pos); 104string s = _chars.Slice(0, _pos).ToString(); 123return _chars.Slice(0, _pos); 137public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 138public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 139public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 143if (_chars.Slice(0, _pos).TryCopyTo(destination)) 165ReadOnlySpan<char> buffer = _chars.Slice(index, _pos - index); 180_chars.Slice(newIndex, _pos - newIndex).CopyTo(_chars.Slice(index + newLength)); 189_chars.Slice(newIndex, _pos - newIndex).CopyTo(_chars.Slice(index + newLength)); 213_chars.Slice(start + length, remaining).CopyTo(_chars.Slice(start)); 226return _chars.Slice(_pos - valueLength, valueLength).SequenceEqual(value.AsSpan()); 237_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 238_chars.Slice(index, count).Fill(value); 257_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 325Span<char> dst = _chars.Slice(_pos, count); 341Span<char> dst = _chars.Slice(_pos, length); 371return _chars.Slice(origPos, length); 407_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.ML.Tokenizers.Tests (22)
BpeTests.cs (1)
328status = bpe.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens, out idsConsumed, out charactersWritten);
CodeGenTests.cs (1)
314status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), hasPrefixSpace, considerSpecialTokens, out idsConsumed, out charactersWritten);
EnglishRobertaTests.cs (1)
319status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten);
LlamaTests.cs (11)
310status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten); 848Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten)); 850Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 862Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens: true, out idsConsumed, out charactersWritten)); 864Assert.True(textWithSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 887Assert.Equal(OperationStatus.DestinationTooSmall, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten)); 889Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 895Assert.Equal(decodedWithNoSpecialTokens, destinationBuffer.AsSpan().Slice(0, charactersWritten).ToString()); 901Assert.Equal(OperationStatus.DestinationTooSmall, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens: true, out idsConsumed, out charactersWritten)); 903var sp = destinationBuffer.AsSpan().Slice(0, charactersWritten); 906sp = sp.Slice(0, sp.Length - 1);
src\Microsoft.ML.Tokenizers\Utils\OrdinalUtf8StringComparer.cs (2)
76int result = buffer1.Slice(0, xLen).SequenceCompareTo(buffer2.Slice(0, yLen));
TiktokenTests.cs (1)
173status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten);
UnigramTests.cs (3)
545Assert.Equal(decodedString, buffer.AsSpan().Slice(0, charsWritten).ToString()); 549status = tokenizer.Decode(ids, buffer.AsSpan().Slice(0, i), considerSpecialTokens: false, out idsConsumed, out charsWritten); 551Assert.Equal(decodedString.AsSpan().Slice(0, charsWritten).ToString(), buffer.AsSpan().Slice(0, charsWritten).ToString());
WordPieceTests.cs (2)
101Span<char> bufferSlice = buffer.Slice(0, i); 114Assert.Equal(j == 0 ? "" : text.Substring(0, tokens[j - 1].Offset.End.Value), bufferSlice.Slice(0, charsWritten).ToString());
Microsoft.ML.Transforms (4)
Dracula\CountTableTransformer.cs (2)
715_parent.Featurizer.GetFeatures(iinfo, i, rand, srcValues[i], editor.Values.Slice(i * outputLength, outputLength)); 725_parent.Featurizer.GetFeatures(iinfo, index, rand, srcValues[i], editor.Values.Slice(index * outputLength, outputLength));
Dracula\Featurizer.cs (2)
143var countsBuffer = features.Slice(0, _labelBinCount); 162GenerateLogOdds(iCol, countTable, countsBuffer, features.Slice(_labelBinCount, _logOddsCount), sum);
Microsoft.Net.Http.Headers (1)
ContentDispositionHeaderValue.cs (1)
563var result = Encoding.UTF8.GetString(buffer.Slice(0, MimePrefix.Length + base64ContentLength + MimeSuffix.Length));
MSBuild (2)
FileUtilities.cs (2)
655return str.Slice(0, sliceLength); 668return hasQuotes ? path.Slice(1, endId - 1) : path;
PresentationCore (2)
System\Windows\Input\TextCompositionManager.cs (2)
414return new string(outputChars.Slice(0, charsWritten)); 866destination = destination.Slice(0, 1);
PresentationFramework (6)
MS\Internal\AppModel\ResourceContainer.cs (6)
210UpdateCachedRMW(key.Slice(0, assemblyName.Length), assembly); 216UpdateCachedRMW(key.Slice(0, assemblyName.Length + assemblyVersion.Length), assembly); 225UpdateCachedRMW(key.Slice(0, totalLength), assembly); 230UpdateCachedRMW(key.Slice(0, assemblyName.Length + assemblyToken.Length), assembly); 273if (!s_registeredResourceManagersLookup.TryGetValue(key.Slice(0, totalLength), out rmwResult)) 286s_registeredResourceManagersLookup[key.Slice(0, totalLength)] = rmwResult;
System.Collections (1)
System\Collections\Generic\SortedSet.cs (1)
1393new BitHelper(span.Slice(0, intArrayLength), clear: true) :
System.Collections.Immutable (1)
System\Collections\Frozen\FrozenSetInternalBase.cs (1)
201seenItems = seenItems.Slice(0, intArrayLength);
System.Collections.Specialized (1)
System\Collections\Specialized\BitVector32.cs (1)
169dst = dst.Slice(prefix.Length, 32);
System.Console (20)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System\ConsolePal.Unix.cs (4)
524bracketPos = readBytes.Slice(0, semiPos).LastIndexOf((byte)'['); 525escPos = readBytes.Slice(0, bracketPos).LastIndexOf(Esc); 530TransferBytes(readBytes.Slice(0, escPos), r); 531TransferBytes(readBytes.Slice(escPos + 1, bracketPos - (escPos + 1)), r);
System\IO\CachedConsoleStream.cs (2)
35WriteOrCache(this, _buffer, charSpan.Slice(0, count)); 54Span<char> lineSpan = charBuffer.Slice(0, lastNewLine);
System\IO\StdInReader.cs (2)
66chars = chars.Slice(0, charLen); 397ConsolePal.WriteToTerminal(bytes.Slice(0, bytesWritten));
System.Diagnostics.DiagnosticSource (15)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System\Diagnostics\Activity.GenerateRootId.netcoreapp.cs (1)
22return new string(result.Slice(0, 1 + charsWritten + s_uniqSuffix.Length));
System\Diagnostics\Metrics\TagList.netcore.cs (2)
201tags.Slice(index, _tagsCount - index).CopyTo(tags.Slice(index + 1)); 218tags.Slice(index + 1, _tagsCount - index - 1).CopyTo(tags.Slice(index));
System.Diagnostics.FileVersionInfo (1)
System\Diagnostics\FileVersionInfo.Unix.cs (1)
205parts = parts.Slice(0, versionSpan.Split(parts, '.'));
System.Diagnostics.Process (17)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetGroupList.cs (1)
31return groups.Slice(0, ngroups).ToArray();
src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (1)
36return groups.Slice(0, rv).IndexOf(gid) >= 0;
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
57return Encoding.UTF8.GetString(spanBuffer.Slice(0, resultLength));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
37return _bytes.Slice(0, byteCount + 1);
System\Diagnostics\Process.Linux.cs (1)
304ReadOnlySpan<byte> argRemainder = buffer.Slice(0, bytesRead);
System.Diagnostics.TextWriterTraceListener (3)
System\Diagnostics\XmlWriterTraceListener.cs (3)
83detail.CopyTo(dst.Slice(prefix.Length + 1, detail.Length)); 400writer.Write(span.Slice(0, charsWritten)); 424writer.Write(span.Slice(0, charsWritten));
System.Formats.Asn1 (18)
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (2)
200stackSpan = stackSpan.Slice(0, sizeLimit); 227ReadOnlySpan<byte> valueSpan = stackSpan.Slice(0, bytesWritten);
System\Formats\Asn1\AsnDecoder.OctetString.cs (1)
527return tmpSpace.Slice(0, bytesWritten);
System\Formats\Asn1\AsnDecoder.Oid.cs (1)
203accumValueBytes.Slice(0, SemanticByteCount).CopyTo(writeSpan);
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (6)
125if (!Utf8Formatter.TryFormat(year, baseSpan.Slice(0, 4), out _, d4) || 126!Utf8Formatter.TryFormat(month, baseSpan.Slice(4, 2), out _, d2) || 127!Utf8Formatter.TryFormat(day, baseSpan.Slice(6, 2), out _, d2) || 128!Utf8Formatter.TryFormat(hour, baseSpan.Slice(8, 2), out _, d2) || 129!Utf8Formatter.TryFormat(minute, baseSpan.Slice(10, 2), out _, d2) || 130!Utf8Formatter.TryFormat(second, baseSpan.Slice(12, 2), out _, d2))
System\Formats\Asn1\AsnWriter.NamedBitList.cs (1)
182temp.Slice(0, byteLen),
System\Formats\Asn1\AsnWriter.Oid.cs (1)
217dest.Slice(0, idx).Reverse();
System\Formats\Asn1\AsnWriter.UtcTime.cs (6)
101if (!Utf8Formatter.TryFormat(year % 100, baseSpan.Slice(0, 2), out _, format) || 102!Utf8Formatter.TryFormat(month, baseSpan.Slice(2, 2), out _, format) || 103!Utf8Formatter.TryFormat(day, baseSpan.Slice(4, 2), out _, format) || 104!Utf8Formatter.TryFormat(hour, baseSpan.Slice(6, 2), out _, format) || 105!Utf8Formatter.TryFormat(minute, baseSpan.Slice(8, 2), out _, format) || 106!Utf8Formatter.TryFormat(second, baseSpan.Slice(10, 2), out _, format))
System.Formats.Cbor (5)
System\Formats\Cbor\Writer\CborWriter.Map.cs (2)
167ReadOnlySpan<byte> keyValuePairEncoding = source.Slice(range.Offset, range.TotalLength); 174tmpSpan.CopyTo(source.Slice(_frameOffset, totalMapPayloadEncodingLength));
System\Formats\Cbor\Writer\CborWriter.String.cs (3)
215buffer.Slice(offset, length).CopyTo(s); 223tempSpan.CopyTo(buffer.Slice(_offset, definiteLength)); 229buffer.Slice(_offset, initialOffset - _offset).Clear();
System.Formats.Nrbf (1)
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (1)
136Span<byte> resultAsBytes = MemoryMarshal.AsBytes<T>(valuesToRead.Slice(0, sliceSize));
System.Formats.Tar (43)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System\Formats\Tar\SeekableSubReadStream.cs (1)
62int bytesRead = _superStream.Read(destination.Slice(0, count));
System\Formats\Tar\SubReadStream.cs (1)
122int ret = _superStream.Read(destination.Slice(0, count));
System\Formats\Tar\TarHeader.Read.cs (2)
587span = span.Slice(0, (int)size); 658span = span.Slice(0, (int)size);
System\Formats\Tar\TarHeader.Write.cs (27)
574return WriteAsUtf8String(name, buffer.Slice(FieldLocations.Name, FieldLengths.Name)); 593ReadOnlySpan<byte> pathNameBytes = encodingBuffer.Slice(0, encoded); 598return WriteLeftAlignedBytesAndGetChecksum(pathNameBytes, buffer.Slice(FieldLocations.Name, FieldLengths.Name)); 634int checksum = WriteLeftAlignedBytesAndGetChecksum(prefix, buffer.Slice(FieldLocations.Prefix, FieldLengths.Prefix)); 635checksum += WriteLeftAlignedBytesAndGetChecksum(name, buffer.Slice(FieldLocations.Name, FieldLengths.Name)); 655checksum += FormatNumeric(_mode, buffer.Slice(FieldLocations.Mode, FieldLengths.Mode)); 660checksum += FormatNumeric(_uid, buffer.Slice(FieldLocations.Uid, FieldLengths.Uid)); 665checksum += FormatNumeric(_gid, buffer.Slice(FieldLocations.Gid, FieldLengths.Gid)); 670checksum += FormatNumeric(_size, buffer.Slice(FieldLocations.Size, FieldLengths.Size)); 673checksum += WriteAsTimestamp(_mTime, buffer.Slice(FieldLocations.MTime, FieldLengths.MTime)); 694checksum += WriteAsUtf8String(linkName, buffer.Slice(FieldLocations.LinkName, FieldLengths.LinkName)); 719int checksum = WriteLeftAlignedBytesAndGetChecksum(UstarMagicBytes, buffer.Slice(FieldLocations.Magic, FieldLengths.Magic)); 720checksum += WriteLeftAlignedBytesAndGetChecksum(UstarVersionBytes, buffer.Slice(FieldLocations.Version, FieldLengths.Version)); 727int checksum = WriteLeftAlignedBytesAndGetChecksum(GnuMagicBytes, buffer.Slice(FieldLocations.Magic, FieldLengths.Magic)); 728checksum += WriteLeftAlignedBytesAndGetChecksum(GnuVersionBytes, buffer.Slice(FieldLocations.Version, FieldLengths.Version)); 752checksum += WriteAsUtf8String(uName, buffer.Slice(FieldLocations.UName, FieldLengths.UName)); 770checksum += WriteAsUtf8String(gName, buffer.Slice(FieldLocations.GName, FieldLengths.GName)); 775checksum += FormatNumeric(_devMajor, buffer.Slice(FieldLocations.DevMajor, FieldLengths.DevMajor)); 780checksum += FormatNumeric(_devMinor, buffer.Slice(FieldLocations.DevMinor, FieldLengths.DevMinor)); 795checksum += WriteAsTimestamp(_aTime, buffer.Slice(FieldLocations.ATime, FieldLengths.ATime)); 799checksum += WriteAsTimestamp(_cTime, buffer.Slice(FieldLocations.CTime, FieldLengths.CTime)); 805checksum += WriteLeftAlignedBytesAndGetChecksum(_gnuUnusedBytes, buffer.Slice(FieldLocations.GnuUnused, FieldLengths.AllGnuUnused)); 830zeros = zeros.Slice(0, paddingAfterData); 926dataStream.Write(span.Slice(0, bytesWritten)); 1041Span<byte> destination = buffer.Slice(FieldLocations.Checksum, FieldLengths.Checksum); 1096destination.Slice(0, copyPos).Fill((byte)'0'); 1190return WriteLeftAlignedBytesAndGetChecksum(buffer.Slice(0, encoded), buffer);
System.IO.Compression (102)
System\IO\Compression\DeflateManaged\InflaterManaged.cs (1)
115bytes = bytes.Slice(0, (int)Math.Min(bytes.Length, _uncompressedSize - _currentInflatedCount));
System\IO\Compression\DeflateManaged\OutputWindow.cs (2)
129output = output.Slice(0, _bytesUsed); 144output = output.Slice(tailLen, copy_end);
System\IO\Compression\ZipArchive.cs (1)
565ReadOnlySpan<byte> sizedFileBuffer = fileBufferSpan.Slice(0, currBytesRead);
System\IO\Compression\ZipArchiveEntry.cs (38)
593ZipCentralDirectoryFileHeader.SignatureConstantBytes.CopyTo(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.Signature..]); 596BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.VersionNeededToExtract..], (ushort)_versionToExtract); 597BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.GeneralPurposeBitFlags..], (ushort)_generalPurposeBitFlag); 598BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.CompressionMethod..], (ushort)CompressionMethod); 599BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.LastModified..], ZipHelper.DateTimeToDosTime(_lastModified.DateTime)); 600BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.Crc32..], _crc32); 601BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.CompressedSize..], compressedSizeTruncated); 602BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.UncompressedSize..], uncompressedSizeTruncated); 603BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.FilenameLength..], (ushort)_storedEntryNameBytes.Length); 604BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.ExtraFieldLength..], extraFieldLength); 605BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.FileCommentLength..], (ushort)_fileComment.Length); 606BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.DiskNumberStart..], 0); 607BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.InternalFileAttributes..], 0); 608BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.ExternalFileAttributes..], _externalFileAttr); 609BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.RelativeOffsetOfLocalHeader..], offsetOfLocalHeaderTruncated); 1063ZipLocalFileHeader.SignatureConstantBytes.CopyTo(lfStaticHeader[ZipLocalFileHeader.FieldLocations.Signature..]); 1064BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.VersionNeededToExtract..], (ushort)_versionToExtract); 1065BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.GeneralPurposeBitFlags..], (ushort)_generalPurposeBitFlag); 1066BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.CompressionMethod..], (ushort)CompressionMethod); 1067BinaryPrimitives.WriteUInt32LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.LastModified..], ZipHelper.DateTimeToDosTime(_lastModified.DateTime)); 1068BinaryPrimitives.WriteUInt32LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.Crc32..], _crc32); 1069BinaryPrimitives.WriteUInt32LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.CompressedSize..], compressedSizeTruncated); 1070BinaryPrimitives.WriteUInt32LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.UncompressedSize..], uncompressedSizeTruncated); 1071BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.FilenameLength..], (ushort)_storedEntryNameBytes.Length); 1072BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.ExtraFieldLength..], extraFieldLength); 1236BinaryPrimitives.WriteUInt16LittleEndian(writeBuffer[relativeVersionToExtractLocation..], (ushort)_versionToExtract); 1237BinaryPrimitives.WriteUInt16LittleEndian(writeBuffer[relativeGeneralPurposeBitFlagsLocation..], (ushort)_generalPurposeBitFlag); 1250BinaryPrimitives.WriteUInt32LittleEndian(writeBuffer[relativeCrc32Location..], _crc32); 1251BinaryPrimitives.WriteUInt32LittleEndian(writeBuffer[relativeCompressedSizeLocation..], compressedSizeTruncated); 1252BinaryPrimitives.WriteUInt32LittleEndian(writeBuffer[relativeUncompressedSizeLocation..], uncompressedSizeTruncated); 1268BinaryPrimitives.WriteInt64LittleEndian(writeBuffer[relativeUncompressedSizeLocation..], _uncompressedSize); 1269BinaryPrimitives.WriteInt64LittleEndian(writeBuffer[relativeCompressedSizeLocation..], _compressedSize); 1302ZipLocalFileHeader.DataDescriptorSignatureConstantBytes.CopyTo(dataDescriptor[ZipLocalFileHeader.ZipDataDescriptor.FieldLocations.Signature..]); 1303BinaryPrimitives.WriteUInt32LittleEndian(dataDescriptor[ZipLocalFileHeader.ZipDataDescriptor.FieldLocations.Crc32..], _crc32); 1307BinaryPrimitives.WriteInt64LittleEndian(dataDescriptor[ZipLocalFileHeader.Zip64DataDescriptor.FieldLocations.CompressedSize..], _compressedSize); 1308BinaryPrimitives.WriteInt64LittleEndian(dataDescriptor[ZipLocalFileHeader.Zip64DataDescriptor.FieldLocations.UncompressedSize..], _uncompressedSize); 1314BinaryPrimitives.WriteUInt32LittleEndian(dataDescriptor[ZipLocalFileHeader.ZipDataDescriptor.FieldLocations.CompressedSize..], (uint)_compressedSize); 1315BinaryPrimitives.WriteUInt32LittleEndian(dataDescriptor[ZipLocalFileHeader.ZipDataDescriptor.FieldLocations.UncompressedSize..], (uint)_uncompressedSize);
System\IO\Compression\ZipBlocks.cs (58)
40BinaryPrimitives.WriteUInt16LittleEndian(extraFieldHeader[FieldLocations.Tag..], _tag); 41BinaryPrimitives.WriteUInt16LittleEndian(extraFieldHeader[FieldLocations.Size..], _size); 371BinaryPrimitives.WriteUInt16LittleEndian(extraFieldData[FieldLocations.Tag..], TagConstant); 372BinaryPrimitives.WriteUInt16LittleEndian(extraFieldData[FieldLocations.Size..], _size); 376BinaryPrimitives.WriteInt64LittleEndian(extraFieldData[startOffset..], _uncompressedSize.Value); 382BinaryPrimitives.WriteInt64LittleEndian(extraFieldData[startOffset..], _compressedSize.Value); 388BinaryPrimitives.WriteInt64LittleEndian(extraFieldData[startOffset..], _localHeaderOffset.Value); 394BinaryPrimitives.WriteUInt32LittleEndian(extraFieldData[startOffset..], _startDiskNumber.Value); 429NumberOfDiskWithZip64EOCD = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.NumberOfDiskWithZip64EOCD..]), 430OffsetOfZip64EOCD = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.OffsetOfZip64EOCD..]), 431TotalNumberOfDisks = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.TotalNumberOfDisks..]) 450SignatureConstantBytes.CopyTo(blockContents[FieldLocations.Signature..]); 452BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.NumberOfDiskWithZip64EOCD..], 0); 453BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.OffsetOfZip64EOCD..], zip64EOCDRecordStart); 455BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.TotalNumberOfDisks..], 1); 502SizeOfThisRecord = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.SizeOfThisRecord..]), 503VersionMadeBy = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.VersionMadeBy..]), 504VersionNeededToExtract = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.VersionNeededToExtract..]), 505NumberOfThisDisk = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.NumberOfThisDisk..]), 506NumberOfDiskWithStartOfCD = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.NumberOfDiskWithStartOfCD..]), 507NumberOfEntriesOnThisDisk = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.NumberOfEntriesOnThisDisk..]), 508NumberOfEntriesTotal = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.NumberOfEntriesTotal..]), 509SizeOfCentralDirectory = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.SizeOfCentralDirectory..]), 510OffsetOfCentralDirectory = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.OffsetOfCentralDirectory..]) 530SignatureConstantBytes.CopyTo(blockContents[FieldLocations.Signature..]); 531BinaryPrimitives.WriteUInt64LittleEndian(blockContents[FieldLocations.SizeOfThisRecord..], NormalSize); 533BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.VersionMadeBy..], (ushort)ZipVersionNeededValues.Zip64); 535BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.VersionNeededToExtract..], (ushort)ZipVersionNeededValues.Zip64); 537BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.NumberOfThisDisk..], 0); 539BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.NumberOfDiskWithStartOfCD..], 0); 541BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.NumberOfEntriesOnThisDisk..], numberOfEntries); 543BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.NumberOfEntriesTotal..], numberOfEntries); 544BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.SizeOfCentralDirectory..], sizeOfCentralDirectory); 545BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.OffsetOfCentralDirectory..], startOfCentralDirectory); 574filenameLength = BinaryPrimitives.ReadUInt16LittleEndian(fixedHeaderBuffer[relativeFilenameLengthLocation..]); 575extraFieldLength = BinaryPrimitives.ReadUInt16LittleEndian(fixedHeaderBuffer[relativeExtraFieldLengthLocation..]); 599Span<byte> extraFieldBuffer = extraFieldLength <= StackAllocationThreshold ? stackalloc byte[StackAllocationThreshold].Slice(0, extraFieldLength) : arrayPoolBuffer.AsSpan(0, extraFieldLength); 647ushort filenameLength = BinaryPrimitives.ReadUInt16LittleEndian(blockBytes[relativeFilenameLengthLocation..]); 648ushort extraFieldLength = BinaryPrimitives.ReadUInt16LittleEndian(blockBytes[relativeExtraFieldLengthLocation..]); 818Span<byte> collatedHeader = dynamicHeaderSize <= StackAllocationThreshold ? stackalloc byte[StackAllocationThreshold].Slice(0, dynamicHeaderSize) : arrayPoolBuffer.AsSpan(0, dynamicHeaderSize); 822Debug.Assert(bytesToRead == collatedHeader[remainingBufferLength..].Length); 823int realBytesRead = furtherReads.ReadAtLeast(collatedHeader[remainingBufferLength..], bytesToRead, throwOnEndOfStream: false); 881SignatureConstantBytes.CopyTo(blockContents[FieldLocations.Signature..]); 883BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.NumberOfThisDisk..], 0); 885BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.NumberOfTheDiskWithTheStartOfTheCentralDirectory..], 0); 887BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.NumberOfEntriesInTheCentralDirectoryOnThisDisk..], numberOfEntriesTruncated); 889BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.NumberOfEntriesInTheCentralDirectory..], numberOfEntriesTruncated); 890BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.SizeOfCentralDirectory..], sizeOfCentralDirectoryTruncated); 891BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.OffsetOfStartOfCentralDirectoryWithRespectToTheStartingDiskNumber..], startOfCentralDirectoryTruncated); 897BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.ArchiveCommentLength..], (ushort)archiveComment.Length); 929Signature = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.Signature..]), 930NumberOfThisDisk = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.NumberOfThisDisk..]), 931NumberOfTheDiskWithTheStartOfTheCentralDirectory = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.NumberOfTheDiskWithTheStartOfTheCentralDirectory..]), 932NumberOfEntriesInTheCentralDirectoryOnThisDisk = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.NumberOfEntriesInTheCentralDirectoryOnThisDisk..]), 933NumberOfEntriesInTheCentralDirectory = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.NumberOfEntriesInTheCentralDirectory..]), 934SizeOfCentralDirectory = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.SizeOfCentralDirectory..]), 936BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.OffsetOfStartOfCentralDirectoryWithRespectToTheStartingDiskNumber..]) 939ushort commentLength = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.ArchiveCommentLength..]);
System\IO\Compression\ZipCustomStreams.cs (1)
323int ret = _superStream.Read(destination.Slice(0, count));
System\IO\Compression\ZipHelper.cs (1)
136bufferSpan = bufferSpan.Slice(0, bytesRead);
System.IO.Compression.Brotli (2)
System\IO\Compression\enc\BrotliStream.Compress.cs (2)
94_stream.Write(output.Slice(0, bytesWritten)); 202_stream.Write(output.Slice(0, bytesWritten));
System.IO.FileSystem.Watcher (12)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System.IO.Hashing (4)
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (4)
169GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 193GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 231GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 255GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
System.IO.MemoryMappedFiles (1)
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (1)
268guid.Slice(0, MaxNameLength - NamePrefix.Length).CopyTo(span.Slice(NamePrefix.Length));
System.Linq (1)
System\Linq\SegmentedArrayBuilder.cs (1)
328_currentSegment.Slice(0, _countInCurrentSegment).CopyTo(destination);
System.Memory (2)
System\Buffers\ReadOnlySequence.Helpers.cs (2)
229return ((MemoryManager<T>)startObject).Memory.Span.Slice(startIndex, endIndex - startIndex); 694return ((MemoryManager<T>)startObject).Memory.Span.Slice(startIndex, endIndex - startIndex);
System.Net.Http (43)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (3)
604return span.Slice(0, length).ToArray(); 616return span.Slice(0, length).ToArray(); 632return span.Slice(0, length).ToArray();
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (5)
44return buffer.Slice(0, bytesWritten).ToArray(); 99return temp.Slice(0, headerBytesWritten).ToArray(); 107return temp.Slice(0, bytesWritten).ToArray(); 169return temp.Slice(0, nameLength).ToArray(); 179return temp.Slice(0, bytesWritten).ToArray();
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System\Net\Http\FormUrlEncodedContent.cs (1)
66ReadOnlySpan<char> escapedChars = builder.RawChars.Slice(builder.Length, charsWritten);
System\Net\Http\MultipartContent.cs (1)
656stream.Write(buffer.Slice(0, written));
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (1)
233return Convert.ToHexStringLower(hashBuffer.Slice(0, written));
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (1)
73int bytesRead = _connection.Read(buffer.Slice(0, (int)Math.Min((ulong)buffer.Length, _chunkBytesRemaining)));
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (1)
34buffer = buffer.Slice(0, (int)_contentBytesRemaining);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (7)
444string response = Encoding.ASCII.GetString(_incomingBuffer.ActiveSpan.Slice(0, Math.Min(20, _incomingBuffer.ActiveLength))); 670GetFrameData(_incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength), frameHeader.PaddedFlag, frameHeader.PriorityFlag), 686_incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength), 754ReadOnlySpan<byte> span = _incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength); 787ReadOnlySpan<byte> frameData = GetFrameData(_incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength), hasPad: frameHeader.PaddedFlag, hasPriority: false); 841ReadOnlySpan<byte> settings = _incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength); 995ReadOnlySpan<byte> pingContent = _incomingBuffer.ActiveSpan.Slice(0, FrameHeader.PingLength);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (1)
527return buffer.Slice(0, 4 + integerLength).ToArray();
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (5)
702int actualHeadersLengthEncodedSize = VariableLengthIntegerHelper.WriteInteger(_sendBuffer.ActiveSpan.Slice(1, headersLengthEncodedSize), headersLength); 942_headerDecoder.Decode(_recvBuffer.ActiveSpan.Slice(0, processLength), endHeaders, this); 1171_recvBuffer.ActiveSpan.Slice(0, copyLen).CopyTo(buffer); 1191int bytesRead = _stream.Read(buffer.Slice(0, copyLen)); 1243_recvBuffer.ActiveSpan.Slice(0, copyLen).CopyTo(buffer.Span);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (5)
1045ParseStatusLineCore(buffer.Slice(0, length), response); 1096throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_code, Encoding.ASCII.GetString(line.Slice(9, 3)))); 1207ReadOnlySpan<byte> headerName = buffer.Slice(0, valueStartIdx - 1); 1208ReadOnlySpan<byte> headerValue = buffer.Slice(valueStartIdx, buffer.Length - valueIterator.Length + crOrLfIdx - valueStartIdx); 1535return WriteAsync(temp.Slice(0, bytesWritten).ToArray());
System.Net.HttpListener (1)
System\Net\HttpListener.cs (1)
209OperationStatus operationStatus = Ascii.ToLowerInPlace(destination.Slice(0, toLowerLength), out _);
System.Net.Mail (16)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System\Net\Base64Stream.cs (2)
189read = DecodeBytes(buffer.Slice(0, read)); 212read = DecodeBytes(buffer.Span.Slice(0, read));
System\Net\Mail\SmtpReplyReaderFactory.cs (2)
276int actual = ProcessRead(buffer.Slice(0, read), false); 279_bufferedStream.Push(buffer.Slice(actual, read - actual));
System.Net.Ping (2)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
37return _bytes.Slice(0, byteCount + 1);
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
316return CreatePingReply(IPStatus.TtlExpired, IPEndPointExtensions.GetIPAddress(socketAddress.Slice(0, header.SocketAddressLen)));
System.Net.Primitives (4)
src\libraries\Common\src\System\Net\NetworkInformation\InterfaceInfoPal.Unix.cs (1)
48.Slice(0, bufferSize);
src\libraries\Common\src\System\Net\SocketAddress.cs (1)
200return result.Slice(0, length).ToString();
System\Net\IPAddress.cs (2)
465_toString = toString = new string(span.Slice(0, length)); 522if (tmpDestination.Slice(0, written).TryCopyTo(destination))
System.Net.Quic (1)
System\Net\Quic\Internal\ReceiveBuffers.cs (1)
58quicBuffer = quicBuffer.Slice(0, totalLength);
System.Net.Requests (1)
System\Net\HttpWebResponse.cs (1)
403int readBytes = innerStream.Read(buffer.Slice(0, (int)Math.Min(buffer.Length, _maxRemainingLength)));
System.Net.Security (21)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (2)
488if (!Ssl.SslAddClientCAs(sslHandle, handles.Slice(0, certList.Count))) 756Span<byte> clientProto = clientList.Slice(1, length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (1)
246Span<byte> buffer = (uint)length <= 256 ? stackalloc byte[256].Slice(0, length) : new byte[length];
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (14)
404Span<byte> blob = payload.Slice(payloadOffset, sizeof(NtChallengeResponse) + serverInfo.Length); 405ref NtChallengeResponse temp = ref MemoryMarshal.AsRef<NtChallengeResponse>(blob.Slice(0, sizeof(NtChallengeResponse))); 621ref AuthenticateMessage response = ref MemoryMarshal.AsRef<AuthenticateMessage>(responseAsSpan.Slice(0, sizeof(AuthenticateMessage))); 644payload.Slice(payloadOffset, ChallengeResponseLength).Clear(); 665int sessionKeyWritten = HMACMD5.HashData(ntlm2hash, responseAsSpan.Slice(response.NtChallengeResponse.PayloadOffset, 16), sessionBaseKey); 671Span<byte> encryptedRandomSessionKey = payload.Slice(payloadOffset, 16); 724hmac.AppendData(signature.Slice(12, 4)); 728seal.Transform(hmacResult.Slice(0, 8), signature.Slice(4, 8)); 770_clientSeal.Transform(input, output.Slice(SignatureLength, input.Length)); 771CalculateSignature(input, _clientSequenceNumber, _clientSigningKey, _clientSeal, output.Slice(0, SignatureLength)); 795_serverSeal.Transform(input.Slice(SignatureLength), output.Slice(0, input.Length - SignatureLength)); 796if (!VerifyMIC(output.Slice(0, input.Length - SignatureLength), input.Slice(0, SignatureLength))) 824if (!VerifyMIC(input.Slice(SignatureLength), input.Slice(0, SignatureLength)))
System\Net\Security\SslStream.cs (3)
84public Span<byte> DecryptedSpan => _buffer.ActiveSpan.Slice(0, _decryptedLength); 89return _buffer.ActiveSpan.Slice(0, length); 96public Span<byte> EncryptedSpanSliced(int length) => _buffer.ActiveSpan.Slice(_decryptedLength + _decryptedPadding, length);
System\Net\Security\SslStream.Protocol.cs (1)
1023NetEventSource.DumpBuffer(this, buffer.Slice(outputOffset, outputCount));
System.Net.Sockets (13)
System\Net\Sockets\NetEventSource.Sockets.cs (1)
58DumpBuffer(thisOrContextObject, buffer.Span.Slice(offset, count), memberName);
System\Net\Sockets\Socket.cs (11)
159new IPAddress((long)SocketAddressPal.GetIPv4Address(buffer.Slice(0, bufferLength)) & 0x0FFFFFFFF), 165SocketAddressPal.GetIPv6Address(buffer.Slice(0, bufferLength), address, out uint scope); 174_rightEndPoint = new UnixDomainSocketEndPoint(buffer.Slice(0, bufferLength)); 193new IPAddress((long)SocketAddressPal.GetIPv4Address(buffer.Slice(0, bufferLength)) & 0x0FFFFFFFF), 199SocketAddressPal.GetIPv6Address(buffer.Slice(0, bufferLength), address, out uint scope); 208_remoteEndPoint = new UnixDomainSocketEndPoint(buffer.Slice(0, bufferLength)); 327_localEndPoint = IPEndPointExtensions.CreateIPEndPoint(buffer.Slice(0, size)); 332buffer.Slice(0, size).CopyTo(socketAddress.Buffer.Span); 373_remoteEndPoint = IPEndPointExtensions.CreateIPEndPoint(buffer.Slice(0, size)); 378buffer.Slice(0, size).CopyTo(socketAddress.Buffer.Span); 814socketAddress.Buffer.Span.Slice(0, socketAddress.Size));
System\Net\Sockets\UnixDomainSocketEndPoint.cs (1)
115public override EndPoint Create(SocketAddress socketAddress) => new UnixDomainSocketEndPoint(socketAddress.Buffer.Span.Slice(0, socketAddress.Size));
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
181url = url.Slice(0, charsWritten);
System.Net.WebSockets (11)
System\Net\WebSockets\Compression\WebSocketDeflater.cs (1)
106Debug.Assert(output.Slice(written - WebSocketInflater.FlushMarkerLength, WebSocketInflater.FlushMarkerLength)
System\Net\WebSockets\Compression\WebSocketInflater.cs (1)
183written += Inflate(_stream, output[written..], FlushCode.SyncFlush);
System\Net\WebSockets\ManagedWebSocket.cs (9)
931_receiveBuffer.Span.Slice(_receiveBufferOffset, receiveBufferBytesToCopy).CopyTo( 960_inflater!.Span.Slice(0, totalBytesReceived) : 961payloadBuffer.Span.Slice(0, totalBytesReceived), header.Mask, _receivedMaskOffsetOffset); 986!TryValidateUtf8(payloadBuffer.Span.Slice(0, totalBytesReceived), header.EndOfMessage, _utf8TextState)) 1104ApplyMask(_receiveBuffer.Span.Slice(_receiveBufferOffset, (int)header.PayloadLength), header.Mask, 0); 1117closeStatusDescription = s_textEncoding.GetString(_receiveBuffer.Span.Slice(_receiveBufferOffset + 2, (int)header.PayloadLength - 2)); 1194ApplyMask(_receiveBuffer.Span.Slice(_receiveBufferOffset, (int)header.PayloadLength), header.Mask, 0); 1213long pongPayload = BinaryPrimitives.ReadInt64BigEndian(_receiveBuffer.Span.Slice(_receiveBufferOffset, (int)header.PayloadLength)); 1595_receiveBuffer.Span.Slice(_receiveBufferOffset, _receiveBufferCount).CopyTo(_receiveBuffer.Span);
System.Net.WebSockets.Client (2)
System\Net\WebSockets\WebSocketHandle.Managed.cs (2)
495string secKey = Convert.ToBase64String(bytes.Slice(0, 16 /*sizeof(Guid)*/)); 508Convert.ToBase64String(bytes.Slice(0, bytesWritten)));
System.Numerics.Tensors (12)
System\Buffers\NIndex.cs (1)
182return new string(span.Slice(0, charsWritten + 1));
System\Buffers\NRange.cs (1)
89return new string(span.Slice(0, pos));
System\Numerics\Tensors\netcore\TensorPrimitives.IsCanonical.cs (1)
32destination.Slice(0, x.Length).Fill(true);
System\Numerics\Tensors\netcore\TensorPrimitives.IsComplexNumber.cs (1)
32destination.Slice(0, x.Length).Clear();
System\Numerics\Tensors\netcore\TensorPrimitives.IsFinite.cs (1)
32destination.Slice(0, x.Length).Fill(true);
System\Numerics\Tensors\netcore\TensorPrimitives.IsImaginaryNumber.cs (1)
32destination.Slice(0, x.Length).Clear();
System\Numerics\Tensors\netcore\TensorPrimitives.IsInteger.cs (1)
31destination.Slice(0, x.Length).Fill(true);
System\Numerics\Tensors\netcore\TensorPrimitives.IsNaN.cs (1)
32destination.Slice(0, x.Length).Clear();
System\Numerics\Tensors\netcore\TensorPrimitives.IsNegative.cs (1)
31destination.Slice(0, x.Length).Clear();
System\Numerics\Tensors\netcore\TensorPrimitives.IsRealNumber.cs (1)
32destination.Slice(0, x.Length).Fill(true);
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (2)
34if (destination1.Slice(0, inputLength).Overlaps(destination2.Slice(0, inputLength)))
System.Private.CoreLib (139)
src\libraries\Common\src\Interop\Interop.Utils.cs (2)
27result = buffer.Slice(0, buffer.IndexOf('\0')).ToString(); 37result = buffer.Slice(0, buffer.IndexOf('\0')).ToString();
src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (1)
36return groups.Slice(0, rv).IndexOf(gid) >= 0;
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (1)
50ReadOnlySpan<char> value = buffer.Slice(0, charCount);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
57return Encoding.UTF8.GetString(spanBuffer.Slice(0, resultLength));
src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
49return GetAndTrimString(stackBuffer.Slice(0, length));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
37return _bytes.Slice(0, byteCount + 1);
src\libraries\System.Private.CoreLib\src\System\Array.cs (1)
2673new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (2)
189return destination.Slice(0, 2); 192return destination.Slice(0, 1);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (1)
512status = DecodeFrom<TBase64Decoder, byte>(decoder, buffer.Slice(0, bufferIdx), bytes, out int localConsumed, out int localWritten, localIsFinalBlock, ignoreWhiteSpace: false);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlDecoder.cs (3)
173byte[] ret = destination.Slice(0, bytesWritten).ToArray(); 269status = DecodeFrom<TBase64Decoder, ushort>(decoder, buffer.Slice(0, bufferIdx), bytes, out int localConsumed, out int localWritten, localIsFinalBlock, ignoreWhiteSpace: false); 388byte[] ret = destination.Slice(0, bytesWritten).ToArray();
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (1)
109Ascii.ToLowerInPlace(destination.Slice(0, bytesWritten), out bytesWritten);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (18)
160InsertionSort(keys.Slice(0, partitionSize), comparer); 166HeapSort(keys.Slice(0, partitionSize), comparer); 171int p = PickPivotAndPartition(keys.Slice(0, partitionSize), comparer); 439InsertionSort(keys.Slice(0, partitionSize)); 445HeapSort(keys.Slice(0, partitionSize)); 450int p = PickPivotAndPartition(keys.Slice(0, partitionSize)); 704InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 710HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 715int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 933InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 939HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 944int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize));
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (4)
1584new BitHelper(span.Slice(0, intArrayLength), clear: true) : 1652new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) : 1657new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) : 1740new BitHelper(span.Slice(0, intArrayLength), clear: true) :
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
src\libraries\System.Private.CoreLib\src\System\Convert.cs (2)
2731tempBuffer = tempBuffer.Slice(0, charsWritten); 3022destination = destination.Slice(0, quotient);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
5749ReadOnlySpan<char> hexValueFormatted = ulongHexScratch.Slice(0, charsWritten); 5796ReadOnlySpan<char> keywordFormatted = ulongHexScratch.Slice(0, charsWritten);
src\libraries\System.Private.CoreLib\src\System\Enum.cs (2)
1945foundItems = foundItems.Slice(0, foundItemsCount); 1989foundItems = foundItems.Slice(0, foundItemsCount);
src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Windows.cs (1)
39span.Slice(0, (int)length).ToString() :
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (3)
166return IsSortable(valueAsUtf16.Slice(0, charCount)); 1038return IndexOf(source, valueAsUtf16.Slice(0, charCount), options); 1410return LastIndexOf(source, valueAsUtf16.Slice(0, charCount), options);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (1)
916int hash = Marvin.ComputeHash32(sortKey.Slice(0, sortKeyLength), Marvin.DefaultSeed);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Invariant.cs (1)
69Span<byte> tmp = sortKey.Slice(0, 2 * sizeof(ushort)); // help with bounds check elimination
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (1)
172int hash = Marvin.ComputeHash32(span.Slice(0, sortKeyLength), Marvin.DefaultSeed);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (2)
106return changed ? new string(buffer.Slice(0, bufferIndex)) : name; 449return result.Slice(0, resultPos).ToString();
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (2)
783result.Append(chars.Slice(0, charCount)); 980return span.Slice(0, charsWritten).ToString();
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (1)
89ReadOnlySpan<char> result = buffer.Slice(0, realLen);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (1)
72ReadOnlySpan<char> result = buffer.Slice(0, realLength);
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (2)
88return new string(destination.Slice(0, charsWritten)); 99return new string(destination.Slice(0, charsWritten));
src\libraries\System.Private.CoreLib\src\System\Index.cs (1)
162return new string(span.Slice(0, charsWritten + 1));
src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (3)
189OutStream.Write(buffer.Slice(0, utf8ByteCount)); 203OutStream.Write(buffer.Slice(0, actualByteCount)); 362OutStream.Write(buffer.Slice(0, actualByteCount + 1 /* length prefix */));
src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (2)
42path.Slice(pos, 6).Fill((byte)'X'); 56return Encoding.UTF8.GetString(path.Slice(0, path.Length - 1)); // trim off the trailing '\0'
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (1)
86_fullPath = _pathBuffer.Slice(0, charsWritten);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (2)
1491return buffer.Slice(0, bytesRead).ToArray(); 1544Span<byte> toStore = bytes.Slice(0, preambleSize + encoded);
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
121return Encoding.UTF8.GetString(path.Slice(0, path.Length - 1)); // trim off the trailing '\0'
src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (1)
171stackalloc Interop.Sys.IOVector[IovStackThreshold].Slice(0, buffersCount) :
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (6)
5281Span<Range> destinationMinusOne = destination.Slice(0, destination.Length - 1); 6261_destination.Slice(_pos, paddingRequired).Fill(' '); 6266_destination.Slice(_pos, paddingRequired).Fill(' '); 6379_destination.Slice(_pos, paddingNeeded).Fill(' '); 6383_destination.Slice(startingPos, charsWritten).CopyTo(_destination.Slice(startingPos + paddingNeeded)); 6384_destination.Slice(startingPos, paddingNeeded).Fill(' ');
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.cs (6)
78return span.Slice(start, length); 95=> span.Slice(0, ClampEnd(span, 0, trimElement)); 346return span.Slice(start, length); 390return span.Slice(0, ClampEnd(span, 0, trimElements)); 817return span.Slice(start, end - start + 1); 833=> span.Slice(0, ClampEnd(span, 0));
src\libraries\System.Private.CoreLib\src\System\Random.cs (2)
228randomBytes = randomBytes.Slice(0, destination.Length); 256randomBytes = randomBytes.Slice(0, destination.Length * 2);
src\libraries\System.Private.CoreLib\src\System\Range.cs (1)
93return new string(span.Slice(0, pos));
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (1)
358foreach (byte b in utf8Bytes.Slice(0, bytesWritten))
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (3)
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));
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (2)
121Span<object?> copyOfArgs = ((Span<object?>)stackArgStorage._args).Slice(0, _argCount); 122Span<bool> shouldCopyBack = ((Span<bool>)stackArgStorage._shouldCopyBack).Slice(0, _argCount);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (3)
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));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (7)
141public ReadOnlySpan<char> Text => _chars.Slice(0, _pos); 435_chars.Slice(_pos, paddingRequired).Fill(' '); 440_chars.Slice(_pos, paddingRequired).Fill(' '); 569_chars.Slice(_pos, paddingNeeded).Fill(' '); 573_chars.Slice(startingPos, charsWritten).CopyTo(_chars.Slice(startingPos + paddingNeeded)); 574_chars.Slice(startingPos, paddingNeeded).Fill(' '); 646_chars.Slice(0, _pos).CopyTo(newArray);
src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (1)
122components = components.Slice(0, numComponents);
src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.cs (1)
266seenValues = seenValues.Slice(0, (int)range);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
112return values.Slice(0, newCount);
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (4)
194span.Slice(index, _decryptedLength - index).CopyTo(span.Slice(index + 1)); 239span.Slice(index + 1, _decryptedLength - (index + 1)).CopyTo(span.Slice(index)); 323span.Slice(0, length).CopyTo(new Span<char>((void*)ptr, length)); 357Span<char> span = AcquireSpan(ref bufferToRelease).Slice(0, _decryptedLength);
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (4)
234combinedBuffer = combinedBuffer.Slice(0, ConcatInto(GetLeftoverData(), bytes, combinedBuffer)); 265if (FallbackBuffer.Fallback(combinedBuffer.Slice(0, combinedBufferBytesConsumed).ToArray(), index: -_leftoverByteCount)) 290combinedBuffer = combinedBuffer.Slice(0, ConcatInto(GetLeftoverData(), bytes, combinedBuffer)); 333if (FallbackBuffer.Fallback(combinedBuffer.Slice(0, combinedBufferBytesConsumed).ToArray(), index: -_leftoverByteCount)
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (2)
233original = original.Slice(0, charCount); 234modified = modified.Slice(0, charCount);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (1)
1421return Insert(index, buffer.Slice(0, charsWritten), 1);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (5)
678AppendFormatted(utf16.Slice(0, charsWritten)) : 725AppendFormatted(utf16.Slice(0, charsWritten)) : 787_destination.Slice(_pos, paddingNeeded).Fill((byte)' '); 791_destination.Slice(startingPos, bytesWritten).CopyTo(_destination.Slice(startingPos + paddingNeeded)); 792_destination.Slice(startingPos, paddingNeeded).Fill((byte)' ');
src\libraries\System.Private.CoreLib\src\System\Version.cs (1)
176return dest.Slice(0, charsWritten).ToString();
src\System\RuntimeHandles.cs (1)
191stackScratch.Slice(0, inHandles.Length) :
src\System\RuntimeType.CoreCLR.cs (1)
851PopulateRtFields(filter, result.Slice(0, count), declaringType, ref list);
System.Private.CoreLib.Generators (5)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
System.Private.Uri (19)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System\IPv4AddressHelper.cs (1)
31return new string(stackSpace.Slice(0, totalChars + charsWritten));
System\IPv6AddressHelper.cs (1)
87return new string(stackSpace.Slice(0, pos));
System\IriHelper.cs (1)
183ReadOnlySpan<byte> encodedBytes = maxUtf8EncodedSpan.Slice(0, bytesWritten);
System\Uri.cs (3)
4408dest.Length = offset + Compress(dest.RawChars.Slice(offset, dest.Length - offset), _syntax); 4611span = span.Slice(0, span.Length - (lastSlash - i - 1)); 4639span = span.Slice(0, span.Length - (lastSlash - i));
System\UriHelper.cs (1)
261foreach (byte b in utf8Bytes.Slice(0, bytesWritten))
System.Private.Windows.Core (13)
System\BufferScope.cs (2)
106public readonly Span<T> this[Range range] => _span[range]; 108public readonly Span<T> Slice(int start, int length) => _span.Slice(start, length);
System\Text\ValueStringBuilder.cs (11)
136public readonly ReadOnlySpan<char> AsSpan(int start) => _chars[start.._pos]; 137public readonly ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 163_chars.Slice(index, remaining).CopyTo(_chars[(index + count)..]); 164_chars.Slice(index, count).Fill(value); 183_chars.Slice(index, remaining).CopyTo(_chars[(index + count)..]); 184s.CopyTo(_chars[index..]); 238s.CopyTo(_chars[pos..]); 247while (!((ISpanFormattable)value).TryFormat(_chars[_pos..], out charsWritten, format: default, provider: default)) 267Span<char> dst = _chars.Slice(_pos, count); 284Span<char> dst = _chars.Slice(_pos, length); 301value.CopyTo(_chars[_pos..]);
System.Private.Xml (16)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System\Xml\Cache\XPathDocumentNavigator.cs (1)
925return buf.Slice(0, idx).ToString();
System\Xml\Schema\XsdDateTime.cs (1)
493return destination.Slice(0, charsWritten).ToString();
System\Xml\Schema\XsdDuration.cs (1)
349return destination.Slice(0, charsWritten).ToString();
System\Xml\Xsl\Runtime\NumberFormatter.cs (1)
95sb.Append(letters.Slice(idx, MaxAlphabeticLength - idx));
System.Reflection.Metadata (13)
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
252parts = parts.Slice(0, attributeValueSpan.Split(parts, '.'));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System.Runtime.Numerics (184)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
System\Number.BigInteger.cs (20)
326ReadOnlySpan<byte> intDigits = number.Digits.Slice(0, Math.Min(number.Scale, number.DigitsCount)); 352: base1E9FromPool = ArrayPool<uint>.Shared.Rent(base1E9Length)).Slice(0, base1E9Length); 378: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(resultLength)).Slice(0, resultLength); 411: powersOf1e9BufferFromPool = ArrayPool<uint>.Shared.Rent(powersOf1e9BufferLength)).Slice(0, powersOf1e9BufferLength); 423: leadingFromPool = ArrayPool<uint>.Shared.Rent(leadingLength)).Slice(0, leadingLength); 427leading = leading.Slice(0, BigIntegerCalculator.ActualLength(leading)); 470: bufferFromPool = ArrayPool<uint>.Shared.Rent(bufferLength)).Slice(0, bufferLength); 476Span<uint> bitsUpper = bits.Slice(multiplierTrailingZeroCount, buffer2.Length + multiplier.Length); 529uint carry = MultiplyAdd(bits.Slice(0, resultLength), PowersOf1e9.TenPowMaxPartial, base1E9[i]); 564bits = bits.Slice(0, bytesWrittenOrNeeded); 645bytes = bytes.Slice(0, bytesWrittenOrNeeded); 1062LeadingPowers1E9.CopyTo(pow1E9.Slice(0, LeadingPowers1E9.Length)); 1065ReadOnlySpan<uint> src = pow1E9.Slice(Indexes[5], Indexes[6] - Indexes[5]); 1072Span<uint> dst = pow1E9.Slice(toExclusive, src.Length << 1); 1076src = pow1E9.Slice(from, toExclusive - from); 1117BigIntegerCalculator.Multiply(left, UInt32PowersOfTen[trailingZeroCount], bits.Slice(0, left.Length + 1)); 1126: powersOfTenFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length); 1157Span<uint> src = powersOfTen.Slice(0, curLength); 1178powersOfTen = powersOfTen.Slice(0, curLength); 1179Span<uint> bits2 = bits.Slice(omittedLength, curLength += left.Length);
System\Numerics\BigInteger.cs (50)
779: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 809: remainderFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 815: quotientFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 932: bitsFromPool = ArrayPool<uint>.Shared.Rent(leftBits.Length)).Slice(0, leftBits.Length); 945: bitsFromPool = ArrayPool<uint>.Shared.Rent(leftBits.Length)).Slice(0, leftBits.Length); 1000: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1060: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1071: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1529buffer = buffer.Slice(0, _bits.Length + 1); 1532NumericsHelpers.DangerousMakeTwosComplement(buffer.Slice(0, buffer.Length - 1)); // Mutates dwords 1553buffer = buffer.Slice(0, count); 1661: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1673: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1685: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1697: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1739: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1751: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1761: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1773: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2350: leftBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2351x = x.Slice(0, left.WriteTo(x)); 2357: rightBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2358y = y.Slice(0, right.WriteTo(y)); 2364: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2406: leftBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2407x = x.Slice(0, left.WriteTo(x)); 2413: rightBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2414y = y.Slice(0, right.WriteTo(y)); 2420: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2457: leftBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2458x = x.Slice(0, left.WriteTo(x)); 2464: rightBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2465y = y.Slice(0, right.WriteTo(y)); 2471: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2511: xdFromPool = ArrayPool<uint>.Shared.Rent(xl)).Slice(0, xl); 2518: zdFromPool = ArrayPool<uint>.Shared.Rent(zl)).Slice(0, zl); 2572: xdFromPool = ArrayPool<uint>.Shared.Rent(xl)).Slice(0, xl); 2600: zdFromPool = ArrayPool<uint>.Shared.Rent(zl)).Slice(0, zl); 2714: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2726: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2736: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2748: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2761: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2803: quotientFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2829: quotientFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2879: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 3282xd = xd.Slice(0, xl); 3293zd = zd.Slice(0, zl); 3437xd = xd.Slice(0, xl); 3448zd = zd.Slice(0, zl);
System\Numerics\BigIntegerCalculator.DivRem.cs (28)
107: leftCopyFromPool = ArrayPool<uint>.Shared.Rent(left.Length)).Slice(0, left.Length); 143: quotientFromPool = ArrayPool<uint>.Shared.Rent(quotientLength)).Slice(0, quotientLength); 180: leftCopyFromPool = ArrayPool<uint>.Shared.Rent(left.Length)).Slice(0, left.Length); 192: quotientActualFromPool = ArrayPool<uint>.Shared.Rent(quotientLength)).Slice(0, quotientLength); 386: bFromPool = ArrayPool<uint>.Shared.Rent(n)).Slice(0, n); 400: aFromPool = ArrayPool<uint>.Shared.Rent(aLength)).Slice(0, aLength); 408bits.Slice(0, sigmaDigit).Clear(); 440: rFromPool = ArrayPool<uint>.Shared.Rent(n + 1)).Slice(0, n + 1); 445: zFromPool = ArrayPool<uint>.Shared.Rent(2 * n)).Slice(0, 2 * n); 455: qFromPool = ArrayPool<uint>.Shared.Rent(n)).Slice(0, n); 460q.Slice(0, quotientUpper.Length).CopyTo(quotientUpper); 467BurnikelZieglerD2n1n(z, b, quotientUpper.Slice(0, n), r); 473a.Slice(i * n, n).CopyTo(z); 474r.Slice(0, n).CopyTo(z.Slice(n)); 475BurnikelZieglerD2n1n(z, b, quotient.Slice(i * n, n), r); 486Debug.Assert(!r.Slice(0, sigmaDigit).ContainsAnyExcept(0u)); 568: r1FromPool = ArrayPool<uint>.Shared.Rent(left.Length)).Slice(0, left.Length); 574DivideGrammarSchool(r1, right, quotient.Slice(0, quotientLength)); 584r1.Slice(0, remainder.Length).CopyTo(remainder); 612: r1FromPool = ArrayPool<uint>.Shared.Rent(right.Length + 1)).Slice(0, right.Length + 1); 615BurnikelZieglerD3n2n(r1.Slice(0, right.Length), left.Slice(0, halfN), right, quotient.Slice(0, halfN), remainder); 641: dFromPool = ArrayPool<uint>.Shared.Rent(right.Length)).Slice(0, right.Length); 658d.Slice(0, n).Clear(); 664left3.CopyTo(remainder.Slice(0, n)); 666Span<uint> rr = remainder.Slice(0, d.Length + 1); 675quotient.Slice(0, qi).Fill(uint.MaxValue); 689bits = bits.Slice(0, left.Length + right.Length);
System\Numerics\BigIntegerCalculator.FastReducer.cs (9)
41_mu = mu.Slice(0, ActualLength(mu)); 58int l2 = DivMul(_q1.Slice(0, l1), _modulus, _q2, _modulus.Length + 1); 61var length = SubMod(value, _q2.Slice(0, l2), _modulus, _modulus.Length + 1); 87bits.Slice(0, left.Length + right.Length)); 93bits.Slice(0, left.Length + right.Length)); 96return ActualLength(bits.Slice(0, left.Length + right.Length)); 110left = left.Slice(0, k); 115left = left.Slice(0, ActualLength(left)); 120left = left.Slice(0, ActualLength(left));
System\Numerics\BigIntegerCalculator.GcdInv.cs (6)
69: rightCopyFromPool = ArrayPool<uint>.Shared.Rent(right.Length)).Slice(0, right.Length); 159left = left.Slice(0, Reduce(left, right)); 169left = left.Slice(0, Refresh(left, count)); 170right = right.Slice(0, Refresh(right, count)); 196left = left.Slice(0, Overwrite(left, Gcd(x, y))); 314return ActualLength(bits.Slice(0, maxLength));
System\Numerics\BigIntegerCalculator.PowMod.cs (40)
28: tempFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length); 34: valueCopyFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length); 61resultLength = MultiplySelf(ref result, resultLength, value.Slice(0, valueLength), ref temp); 67return result.Slice(0, resultLength); 78Multiply(left.Slice(0, leftLength), right, temp.Slice(0, resultLength)); 82Multiply(right, left.Slice(0, leftLength), temp.Slice(0, resultLength)); 90return ActualLength(left.Slice(0, resultLength)); 100Square(value.Slice(0, valueLength), temp.Slice(0, resultLength)); 107return ActualLength(value.Slice(0, resultLength)); 221: valueCopyFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 230Remainder(value, modulus, valueCopy.Slice(0, value.Length)); 240: tempFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length); 270: valueCopyFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 279Remainder(value, modulus, valueCopy.Slice(0, value.Length)); 289: tempFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length); 328: rFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 335: muFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 342: q1FromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 348: q2FromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 388: rFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 395: muFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 402: q1FromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 408: q2FromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 447resultLength = MultiplySelf(ref result, resultLength, value.Slice(0, valueLength), ref temp); 448resultLength = Reduce(result.Slice(0, resultLength), modulus); 451valueLength = Reduce(value.Slice(0, valueLength), modulus); 474resultLength = MultiplySelf(ref result, resultLength, value.Slice(0, valueLength), ref temp); 475resultLength = Reduce(result.Slice(0, resultLength), modulus); 480valueLength = Reduce(value.Slice(0, valueLength), modulus); 485return result.Slice(0, resultLength); 506resultLength = MultiplySelf(ref result, resultLength, value.Slice(0, valueLength), ref temp); 507resultLength = reducer.Reduce(result.Slice(0, resultLength)); 510valueLength = reducer.Reduce(value.Slice(0, valueLength)); 533resultLength = MultiplySelf(ref result, resultLength, value.Slice(0, valueLength), ref temp); 534resultLength = reducer.Reduce(result.Slice(0, resultLength)); 539valueLength = reducer.Reduce(value.Slice(0, valueLength)); 544return result.Slice(0, resultLength);
System\Numerics\BigIntegerCalculator.SquMul.cs (13)
89Span<uint> bitsLow = bits.Slice(0, n2); 102: foldFromPool = ArrayPool<uint>.Shared.Rent(foldLength)).Slice(0, foldLength); 109: coreFromPool = ArrayPool<uint>.Shared.Rent(coreLength)).Slice(0, coreLength); 217Span<uint> bitsLow = bits.Slice(0, n + right.Length); 227: carryFromPool = ArrayPool<uint>.Shared.Rent(carryLength)).Slice(0, carryLength); 229Span<uint> carryOrig = bits.Slice(n, right.Length); 235MultiplyKaratsuba(right, leftHigh, bitsHigh.Slice(0, leftHigh.Length + right.Length), (right.Length + 1) >> 1); 237Multiply(leftHigh, right, bitsHigh.Slice(0, leftHigh.Length + right.Length)); 269Span<uint> bitsLow = bits.Slice(0, n + n); 286: leftFoldFromPool = ArrayPool<uint>.Shared.Rent(foldLength)).Slice(0, foldLength); 292: rightFoldFromPool = ArrayPool<uint>.Shared.Rent(foldLength)).Slice(0, foldLength); 305: coreFromPool = ArrayPool<uint>.Shared.Rent(coreLength)).Slice(0, coreLength); 323AddSelf(bits.Slice(n), core.Slice(0, ActualLength(core)));
System\Numerics\BigIntegerCalculator.Utils.cs (1)
74return ActualLength(bits.Slice(0, modulus.Length));
System.Security.Cryptography (115)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
57return Encoding.UTF8.GetString(spanBuffer.Slice(0, resultLength));
src\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (1)
305return destination.Slice(0, actualLength);
src\libraries\Common\src\System\Security\Cryptography\EccKeyFormatHelper.cs (2)
784writer.WriteOctetString(basePointBytes.Slice(0, basePointLength)); 812writer.WriteBitString(publicKeyBytes.Slice(0, publicKeyLength));
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanDerivation.cs (1)
225p.Slice(0, len).CopyTo(retSpan);
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanOpenSsl.Derive.cs (1)
174secret = secret.Slice(0, written);
src\libraries\Common\src\System\Security\Cryptography\ECDsaOpenSsl.cs (4)
91derSignature = derSignature.Slice(0, written); 129derSignature = derSignature.Slice(0, written); 145tmpDerSignature = tmpDerSignature.Slice(0, bytesWritten); 190toVerify = derSignature.Slice(0, derSize);
src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (4)
133SignDataCore(data, context, destination.Slice(0, Algorithm.SignatureSizeInBytes)); 630ExportMLDsaPublicKeyCore(destination.Slice(0, Algorithm.PublicKeySizeInBytes)); 657ExportMLDsaSecretKeyCore(destination.Slice(0, Algorithm.SecretKeySizeInBytes)); 684ExportMLDsaPrivateSeedCore(destination.Slice(0, Algorithm.PrivateSeedSizeInBytes));
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (10)
192buf = buf.Slice(0, byteCount); 202buf = buf.Slice(0, written); 477buf = buf.Slice(0, byteCount); 487buf = buf.Slice(0, written); 662iv = iv.Slice(0, rc2Parameters.Iv.Length); 711iv = iv.Slice(0, bytesWritten); 843Span<byte> k = dk.Slice(0, 8); 844Span<byte> iv = dk.Slice(8, 8); 999t = t.Slice(0, tLength); 1014t.Slice(0, dk.Length).CopyTo(dk);
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (2)
202hashBuf.Slice(0, destination.Length).CopyTo(destination); 288Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length));
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (3)
98return destination.Slice(0, bytesWritten).ToArray(); 145tmp.Slice(0, written).CopyTo(destination); 152CryptographicOperations.ZeroMemory(tmp.Slice(0, written));
src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (12)
135Span<byte> ps = destination.Slice(2, destination.Length - source.Length - 3); 282destination.Slice(2, paddingLength).Fill(0xFF); 316Span<byte> seed = destination.Slice(1, hLen); 324Span<byte> lHash = db.Slice(0, hLen); 326Span<byte> ps = db.Slice(hLen, db.Length - hLen - 1 - mDest.Length); 327Span<byte> psEnd = db.Slice(hLen + ps.Length, 1); 410destination.Slice(0, destination.Length - emLen).Clear(); 413Span<byte> em = destination.Slice(destination.Length - emLen, emLen); 417Span<byte> db = em.Slice(0, dbLen); 418Span<byte> hDest = em.Slice(dbLen, hLen); 448db.Slice(0, psLen).Clear(); 624tmp.Slice(0, writePtr.Length).CopyTo(writePtr);
src\libraries\Common\src\System\Security\Cryptography\Utf8DataEncoding.cs (1)
23_buffer = _buffer.Slice(0, written);
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (2)
634ReadOnlySpan<byte> lengthPart = earlyBuf.Slice(1, read - 1); 651earlyBuf.Slice(0, read).CopyTo(rented);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
37return _bytes.Slice(0, byteCount + 1);
System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (3)
79CopySignatureField(rDer, destination.Slice(0, fieldSizeBytes)); 80CopySignatureField(sDer, destination.Slice(fieldSizeBytes, fieldSizeBytes)); 210response.Slice(0, writeOffset).Clear();
System\Security\Cryptography\Base64Transforms.cs (2)
266return transformBuffer.Slice(0, index + inputBuffer.Length); 303transformBuffer = transformBuffer.Slice(0, bytesToTransform);
System\Security\Cryptography\DSA.cs (4)
231return signature.Slice(0, bytesWritten).ToArray(); 438return signature.Slice(0, bytesWritten).ToArray(); 546TryCreateSignature(destination.Slice(0, hashLength), destination, out bytesWritten)) 887return tmp.Slice(0, hashSize);
System\Security\Cryptography\ECDsa.cs (4)
162byte[] ret = signature.Slice(0, bytesWritten).ToArray(); 444byte[] ret = signature.Slice(0, bytesWritten).ToArray(); 903hashSpan = hashSpan.Slice(0, bytesWritten); 1207return tmp.Slice(0, hashSize);
System\Security\Cryptography\HKDF.cs (1)
62prk = prk.Slice(0, hashLength);
System\Security\Cryptography\HKDFManagedImplementation.cs (3)
41tempInfoBuffer = tempInfoBuffer.Slice(0, info.Length); 61t = remainingOutput.Slice(0, hashLength); 72lastChunk.Slice(0, remainingOutput.Length).CopyTo(remainingOutput);
System\Security\Cryptography\OpenSslAsnFormatter.cs (1)
81return Encoding.UTF8.GetString(buffer.Slice(0, total));
System\Security\Cryptography\OpenSslCipherLite.cs (1)
113tmpSpan.Slice(0, written).CopyTo(output);
System\Security\Cryptography\PemEncoding.cs (1)
239return destination.Slice(0, size);
System\Security\Cryptography\RandomNumberGenerator.cs (4)
319Span<byte> remainingRandom = randomBuffer.Slice(0, Math.Min(RandomBufferSize, needed)); 339remainingRandom = randomBuffer.Slice(0, Math.Min(RandomBufferSize, needed)); 375randomBytes = randomBytes.Slice(0, destination.Length); 403randomBytes = randomBytes.Slice(0, destination.Length * 2);
System\Security\Cryptography\RandomNumberGeneratorImplementation.cs (1)
89remainder.Slice(0, next0Byte).CopyTo(data.Slice(first0Byte));
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
297uiSpan = uiSpan.Slice(0, _blockSize);
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (1)
285Span<byte> passwordBytes = passwordBuffer.Slice(0, passwordBytesWritten);
System\Security\Cryptography\RSA.cs (1)
417TrySignHash(destination.Slice(0, hashLength), destination, hashAlgorithm, padding, out bytesWritten))
System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (2)
69hmacBuffer.Slice(0, destination.Length).CopyTo(destination); 75CryptographicOperations.ZeroMemory(hmacBuffer.Slice(0, hmacBufferWritten));
System\Security\Cryptography\SymmetricAlgorithm.cs (2)
784byte[] plaintext = decryptBuffer.Slice(0, written).ToArray(); 785CryptographicOperations.ZeroMemory(decryptBuffer.Slice(0, written));
System\Security\Cryptography\SymmetricPadding.cs (4)
69destination.Slice(count, padBytes - 1).Clear(); 86RandomNumberGenerator.Fill(destination.Slice(count, padBytes - 1)); 103destination.Slice(count, padBytes).Fill((byte)padBytes); 124destination.Slice(count, padBytes).Clear();
System\Security\Cryptography\UniversalCryptoDecryptor.cs (2)
112Span<byte> decryptedBytes = ciphertext.Slice(0, decryptWritten); 117decryptedBytes.Slice(0, unpaddedLength).CopyTo(outputBuffer);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (1)
38int transformWritten = BasicSymmetricCipher.TransformFinal(outputBuffer.Slice(0, padWritten), outputBuffer);
System\Security\Cryptography\UniversalCryptoOneShot.cs (11)
41Span<byte> transformBuffer = output.Slice(0, bytesTransformed); 88stackBuffer.Slice(0, stackTransformFinal), 91Span<byte> writtenDepadded = stackBuffer.Slice(0, depaddedLength); 139stackBuffer.Slice(0, finalTransformWritten), 142Span<byte> depaddedFinalTransform = stackBuffer.Slice(0, depaddedLength); 147CryptographicOperations.ZeroMemory(output.Slice(0, writtenToOutput)); 159CryptographicOperations.ZeroMemory(output.Slice(0, writtenToOutput)); 160CryptographicOperations.ZeroMemory(stackBuffer.Slice(0, finalTransformWritten)); 177decryptedBuffer = buffer.Slice(0, transformWritten); 191decryptedBuffer.Slice(0, unpaddedLength).CopyTo(output); 226Span<byte> paddedOutput = output.Slice(0, padWritten);
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (1)
815return Encoding.UTF8.GetString(buffer.Slice(0, total));
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (1)
285tempChain = tempChain.Slice(0, chainSize);
System\Security\Cryptography\X509Certificates\X500NameEncoder.cs (1)
504data = destination.Slice(0, written);
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
468return Convert.ToHexString(buffer.Slice(0, written));
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (2)
750return FindByThumbprintCore(hashAlgorithm, thumbprint.Slice(0, bytesWritten)); 791if (thumbprintBuffer.Slice(0, bytesWritten).SequenceEqual(thumbprintBytes))
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (1)
212return hash.Slice(0, TruncateSize).ToArray();
System\Security\Cryptography\XmlKeyHelper.cs (1)
152builder.Append(base64.Slice(0, written));
System.Security.Cryptography.Cose (8)
System\Security\Cryptography\Cose\CoseHelpers.cs (2)
324ReadOnlySpan<byte> encodedValue = buffer.Slice(0, bytesWritten); 353writer.WriteByteString(buffer.Slice(0, bytesWritten));
System\Security\Cryptography\Cose\CoseMessage.cs (1)
419hasher.AppendData(buffer.Slice(0, bytesWritten));
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (4)
383WriteCoseSignaturesArray(writer, signer, buffer.Slice(protectedMapBytesWritten), buffer.Slice(0, protectedMapBytesWritten), associatedData, content, contentStream); 455AppendToBeSigned(buffer, hasher, SigStructureContext.Signature, bodyProtected, buffer.Slice(0, signProtectedBytesWritten), associatedData, content, contentStream); 779byte[] encodedSignProtected = bufferSpan.Slice(0, bytesWritten).ToArray(); 786byte[] signature = bufferSpan.Slice(0, bytesWritten).ToArray();
System\Security\Cryptography\Cose\CoseSign1Message.cs (1)
321AppendToBeSigned(buffer, hasher, SigStructureContext.Signature1, buffer.Slice(0, protectedMapBytesWritten), ReadOnlySpan<byte>.Empty, associatedData, contentBytes, contentStream);
System.Security.Cryptography.Pkcs (17)
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (10)
192buf = buf.Slice(0, byteCount); 202buf = buf.Slice(0, written); 477buf = buf.Slice(0, byteCount); 487buf = buf.Slice(0, written); 662iv = iv.Slice(0, rc2Parameters.Iv.Length); 711iv = iv.Slice(0, bytesWritten); 843Span<byte> k = dk.Slice(0, 8); 844Span<byte> iv = dk.Slice(8, 8); 999t = t.Slice(0, tLength); 1014t.Slice(0, dk.Length).CopyTo(dk);
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (2)
202hashBuf.Slice(0, destination.Length).CopyTo(destination); 288Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length));
System\Security\Cryptography\Pkcs\CmsSignature.cs (2)
188val.CopyTo(ieeeSignature.Slice(fieldSize - val.Length, val.Length)); 200val.CopyTo(ieeeSignature.Slice(fieldSize + fieldSize - val.Length, val.Length));
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (2)
185return VerifyHash(stackSpan.Slice(0, bytesWritten), hashAlgorithmId.Value); 522thumbprint = thumbprint.Slice(0, written);
System\Security\Cryptography\Pkcs\SignerInfo.cs (1)
785digest = digestValue.Slice(0, bytesWritten);
System.Security.Cryptography.ProtectedData (1)
src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
49return GetAndTrimString(stackBuffer.Slice(0, length));
System.Text.Encodings.Web (17)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System\Text\Encodings\Web\DefaultHtmlEncoder.cs (1)
194destination = destination.Slice(3, idxOfSemicolon - 3);
System\Text\Encodings\Web\OptimizedInboxTextEncoder.Ascii.cs (1)
44encodedCharCount = innerEncoder.EncodeUtf16(rune, tempBuffer.Slice(0, 6));
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (2)
87_allowedAsciiBytes = SearchValues.Create(allowedAsciiBytes.Slice(0, allowedAsciiCount)); 88_allowedAsciiChars = SearchValues.Create(allowedAsciiChars.Slice(0, allowedAsciiCount));
System\Text\Encodings\Web\TextEncoder.cs (1)
62utf16ScratchBuffer = utf16ScratchBuffer.Slice(0, charsWritten);
System.Text.Json (132)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
65? (stackalloc (TKey, int)[StackallocThreshold]).Slice(0, span.Length)
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
133string result = destination.Slice(0, charsWritten).ToString(); 137destination.Slice(0, charsWritten).Clear(); 162destination.Slice(0, charsWritten).Clear();
System\Text\Json\Document\JsonDocument.cs (2)
326result = TextEquals(index, otherUtf8Text.Slice(0, written), isPropertyName, shouldUnescape: true); 331otherUtf8Text.Slice(0, written).Clear();
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (2)
34utf8Name = utf8Name.Slice(0, len); 195if (utf8Unescaped.Slice(0, written).SequenceEqual(propertyName.Slice(idx)))
System\Text\Json\JsonEncodedText.cs (1)
90utf8Bytes = utf8Bytes.Slice(0, actualByteCount);
System\Text\Json\JsonHelpers.Escaping.cs (2)
46byte[] escapedString = escapedValue.Slice(0, written).ToArray(); 74byte[] propertySection = GetPropertyNameSection(escapedValue.Slice(0, written));
System\Text\Json\Nodes\JsonArray.cs (1)
255path.Append(chars.Slice(0, charsWritten));
System\Text\Json\Reader\JsonReaderHelper.cs (3)
90sourceUnescaped = sourceUnescaped.Slice(0, written); 112sourceUnescaped = sourceUnescaped.Slice(0, written); 134utf8Unescaped = utf8Unescaped.Slice(0, written);
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (10)
25utf8Unescaped = utf8Unescaped.Slice(0, written); 55utf8Unescaped = utf8Unescaped.Slice(0, written); 82ReadOnlySpan<byte> propertyName = utf8Unescaped.Slice(0, written).ToArray(); 107utf8Unescaped = utf8Unescaped.Slice(0, written); 140utf8Escaped = utf8Escaped.Slice(0, length); 145utf8Unescaped = utf8Unescaped.Slice(0, written); 182utf8Unescaped1 = utf8Unescaped1.Slice(0, written); 186utf8Unescaped2 = utf8Unescaped2.Slice(0, written); 214bytes = utf8Unescaped.Slice(0, bytesWritten).ToArray(); 242bytes = byteSpan.Slice(0, bytesWritten).ToArray();
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (1)
623throw GetInvalidLiteralMultiSegment(readSoFar.Slice(0, written).ToArray());
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (8)
90utf8Destination.Slice(0, bytesWritten).Clear(); 110JsonReaderHelper.ValidateUtf8(utf8Destination.Slice(0, bytesWritten)); 162unescapedSource = unescapedBuffer.Slice(0, bytesWritten); 176unescapedSource = intermediate.Slice(0, valueLength); 213source = intermediate.Slice(0, sequenceLength); 1259span = stackSpan.Slice(0, (int)sequenceLength); 1324span = stackSpan.Slice(0, (int)sequenceLength); 1390span = stackSpan.Slice(0, (int)sequenceLength);
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (1)
47source = stackSpan.Slice(0, bytesWritten);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
249charBuffer = charBuffer.Slice(0, charsWritten);
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (5)
48byteBuffer = byteBuffer.Slice(0, written); 69writer.WriteRawValue(buffer.Slice(0, written)); 82writer.WritePropertyName(buffer.Slice(0, written)); 123writer.WriteRawValue(buffer.Slice(0, length)); 143return JsonReaderHelper.TryGetFloatingPointConstant(buffer.Slice(0, written), out value);
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (3)
46if (!Int128.TryParse(buffer.Slice(0, written), CultureInfo.InvariantCulture, out Int128 result)) 63writer.WriteRawValue(buffer.Slice(0, written)); 101writer.WriteRawValue(buffer.Slice(0, length));
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (3)
51source = stackSpan.Slice(0, bytesWritten); 86writer.WriteStringValue(output.Slice(0, bytesWritten)); 96writer.WritePropertyName(output.Slice(0, bytesWritten));
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (3)
51source = stackSpan.Slice(0, bytesWritten); 84writer.WriteStringValue(output.Slice(0, bytesWritten)); 94writer.WritePropertyName(output.Slice(0, bytesWritten));
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (3)
46if (!UInt128.TryParse(buffer.Slice(0, written), CultureInfo.InvariantCulture, out UInt128 result)) 63writer.WriteRawValue(buffer.Slice(0, written)); 101writer.WriteRawValue(buffer.Slice(0, length));
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (3)
47ReadOnlySpan<char> source = charBuffer.Slice(0, bytesWritten); 97writer.WriteStringValue(span.Slice(0, charsWritten)); 120writer.WritePropertyName(span.Slice(0, charsWritten));
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
399utf8 = utf8.Slice(0, actualByteCount); 430utf8 = utf8.Slice(0, actualByteCount);
System\Text\Json\Writer\JsonWriterHelper.cs (1)
35buffer.Slice(0, indent).Fill(indentByte);
System\Text\Json\Writer\JsonWriterHelper.Date.cs (4)
20TrimDateTimeOffset(tempSpan.Slice(0, bytesWritten), out bytesWritten); 21tempSpan.Slice(0, bytesWritten).CopyTo(buffer); 29TrimDateTimeOffset(tempSpan.Slice(0, bytesWritten), out bytesWritten); 30tempSpan.Slice(0, bytesWritten).CopyTo(buffer);
System\Text\Json\Writer\Utf8JsonWriter.cs (2)
827WriteStartByOptions(escapedPropertyName.Slice(0, written), token); 976WriteStartByOptions(escapedPropertyName.Slice(0, written), token);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (2)
149WriteBase64ByOptions(escapedPropertyName.Slice(0, written), bytes); 172WriteBase64ByOptions(escapedPropertyName.Slice(0, written), bytes);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (3)
156WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 179WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 383WritePropertyNameUnescaped(buffer.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (3)
155WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 178WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 382WritePropertyNameUnescaped(buffer.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (3)
155WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 178WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 371WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (3)
159WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 182WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 376WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (3)
159WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 182WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 375WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (2)
129WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 152WriteNumberByOptions(escapedPropertyName.Slice(0, written), value);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (3)
155WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 178WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 387WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (3)
274WriteLiteralByOptions(escapedPropertyName.Slice(0, written), value); 297WriteLiteralByOptions(escapedPropertyName.Slice(0, written), value); 520WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (3)
228WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 251WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 449WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (4)
909WriteStringByOptions(escapedPropertyName, escapedValue.Slice(0, written)); 932WriteStringByOptions(escapedPropertyName, escapedValue.Slice(0, written)); 955WriteStringByOptions(escapedPropertyName.Slice(0, written), escapedValue); 978WriteStringByOptions(escapedPropertyName.Slice(0, written), escapedValue);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (3)
237WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 260WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 458WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (1)
102WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (1)
150WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (1)
150WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (1)
215utf8Json = utf8Json.Slice(0, actualByteCount);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (1)
115WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (2)
198WriteStringByOptions(escapedValue.Slice(0, written)); 345WriteStringByOptions(escapedValue.Slice(0, written));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (12)
72combinedBuffer = combinedBuffer.Slice(0, ConcatInto(partialStringDataBuffer, value, combinedBuffer)); 80value = combinedBuffer.Slice(0, charsConsumed); 88partialStringDataBuffer = combinedBuffer.Slice(0, charsConsumed); 94partialStringDataBuffer = combinedBuffer.Slice(0, charsConsumed); 148WriteStringSegmentData(escapedValue.Slice(0, written)); 240combinedBuffer = combinedBuffer.Slice(0, ConcatInto(partialStringDataBuffer, utf8Value, combinedBuffer)); 248utf8Value = combinedBuffer.Slice(0, bytesConsumed); 256partialStringDataBuffer = combinedBuffer.Slice(0, bytesConsumed); 262partialStringDataBuffer = combinedBuffer.Slice(0, bytesConsumed); 314WriteStringSegmentData(escapedValue.Slice(0, written)); 407combinedBuffer = combinedBuffer.Slice(0, ConcatInto(partialStringDataBuffer, bytes, combinedBuffer)); 412partialStringDataBuffer = combinedBuffer.Slice(0, 3);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (1)
117WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System.Text.Json.SourceGeneration (8)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
133string result = destination.Slice(0, charsWritten).ToString(); 137destination.Slice(0, charsWritten).Clear(); 162destination.Slice(0, charsWritten).Clear();
System.Text.RegularExpressions (23)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
System\Text\RegularExpressions\RegexCharClass.cs (1)
1989Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
134chars = scratch.Slice(0, scratchCount).ToArray();
System\Text\RegularExpressions\RegexNode.cs (1)
1457return new StartingLiteralData(setChars: setChars.Slice(0, numChars).ToString(), negated: RegexCharClass.IsNegated(node.Str!));
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (3)
176foreach (char suffix in setChars.Slice(1, charCount - 1)) 569result.Chars = scratch.Slice(0, count).ToArray(); 1212chars = chars.Slice(0, RegexCharClass.GetSetChars(nextChild.Str!, chars));
System.Text.RegularExpressions.Generator (26)
RegexGenerator.Emitter.cs (3)
560helperName = $"IndexOfAny{(negatedCategory ? "Except" : "")}{string.Concat(categories.Slice(0, numCategories).ToArray().Select(c => c.ToString()))}"; 1749foreach (char c in setChars.Slice(0, numChars)) 1811writer.WriteLine($"case {string.Join(" or ", setChars.Slice(0, numChars).ToArray().Select(Literal))}:");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (1)
1989Span<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 (1)
134chars = scratch.Slice(0, scratchCount).ToArray();
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (1)
1457return new StartingLiteralData(setChars: setChars.Slice(0, numChars).ToString(), negated: RegexCharClass.IsNegated(node.Str!));
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (3)
176foreach (char suffix in setChars.Slice(1, charCount - 1)) 569result.Chars = scratch.Slice(0, count).ToArray(); 1212chars = chars.Slice(0, RegexCharClass.GetSetChars(nextChild.Str!, chars));
System.Web.HttpUtility (17)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (12)
92string s = _chars.Slice(0, _pos).ToString(); 111return _chars.Slice(0, _pos); 114public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 116public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 120if (_chars.Slice(0, _pos).TryCopyTo(destination)) 142_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 143_chars.Slice(index, count).Fill(value); 162_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 230Span<char> dst = _chars.Slice(_pos, count); 260return _chars.Slice(origPos, length); 296_chars.Slice(0, _pos).CopyTo(poolArray);
System\Web\HttpUtility.cs (1)
209return HttpEncoder.UrlDecode(bytes.Slice(0, encodedBytes));
System\Web\Util\HttpEncoder.cs (4)
237return decodedBytes.Slice(0, decodedBytesCount).ToArray(); 466return UrlEncode(byteSpan.Slice(0, encodedBytes)); 633_numChars += _encoding.GetChars(_byteBuffer.Slice(0, _numBytes), _charBuffer.Slice(_numChars)); 677Span<char> chars = _charBuffer.Slice(0, _numChars);
System.Windows.Forms (8)
System\Windows\Forms\Controls\ImageList\ImageListStreamer.cs (1)
43RunLengthEncoder.TryEncode(input, writer.Span[writer.Position..], out int written);
System\Windows\Forms\Rendering\ControlPaint.cs (7)
583allData = allData[topWidth..]; 585allData = allData[topWidth..]; 587allData = allData[leftWidth..]; 589allData = allData[leftWidth..]; 591allData = allData[bottomWidth..]; 593allData = allData[bottomWidth..]; 595allData = allData[rightWidth..];
System.Windows.Forms.Design (4)
System\ComponentModel\Design\ByteViewer.cs (1)
211lineBuffer[i].TryFormat(charsBuffer.Slice(charsWritten, 2), out _, "X2");
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (2)
307guid.TryFormat(chars[prefix.Length..], out _); 308chars[prefix.Length..].Replace('-', '_');
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (1)
1027baseName.AsSpan(i).Replace(span[i..], '`', '_');