1299 references to Slice
http2cat (18)
src\Shared\Http2cat\Http2Utilities.cs (15)
197writableBuffer.Write(buffer.Slice(0, length)); 212writableBuffer.Write(buffer.Slice(0, length)); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 299writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 338writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 385writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 503await SendAsync(buffer.Span.Slice(0, length)); 568await SendAsync(buffer.Span.Slice(0, length)); 596await 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)
197writableBuffer.Write(buffer.Slice(0, length)); 212writableBuffer.Write(buffer.Slice(0, length)); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 299writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 338writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 385writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 503await SendAsync(buffer.Span.Slice(0, length)); 568await SendAsync(buffer.Span.Slice(0, length)); 596await 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)
197writableBuffer.Write(buffer.Slice(0, length)); 212writableBuffer.Write(buffer.Slice(0, length)); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 299writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 338writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 385writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 503await SendAsync(buffer.Span.Slice(0, length)); 568await SendAsync(buffer.Span.Slice(0, length)); 596await 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)
197writableBuffer.Write(buffer.Slice(0, length)); 212writableBuffer.Write(buffer.Slice(0, length)); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 299writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 338writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 385writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 503await SendAsync(buffer.Span.Slice(0, length)); 568await SendAsync(buffer.Span.Slice(0, length)); 596await 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)
197writableBuffer.Write(buffer.Slice(0, length)); 212writableBuffer.Write(buffer.Slice(0, length)); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 299writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 338writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 385writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 503await SendAsync(buffer.Span.Slice(0, length)); 568await SendAsync(buffer.Span.Slice(0, length)); 596await 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)
197writableBuffer.Write(buffer.Slice(0, length)); 212writableBuffer.Write(buffer.Slice(0, length)); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 299writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 338writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 385writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 503await SendAsync(buffer.Span.Slice(0, length)); 568await SendAsync(buffer.Span.Slice(0, length)); 596await 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();
InMemory.FunctionalTests (15)
Http2\Http2TestBase.cs (13)
633var extendedHeader = buffer.Slice(0, extendedHeaderLength); 635var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 638var padding = buffer.Slice(extendedHeaderLength + length, padLength); 649writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 675var extendedHeader = buffer.Slice(0, extendedHeaderLength); 690writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 721var extendedHeader = buffer.Slice(0, extendedHeaderLength); 725var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 728var padding = buffer.Slice(extendedHeaderLength + length, padLength); 739writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 850await SendAsync(buffer.Span.Slice(0, length)); 920await SendAsync(buffer.Span.Slice(0, length)); 948await SendAsync(buffer.Span.Slice(0, length));
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (2)
50writer.Write(buffer.Slice(0, length)); 65writer.Write(buffer.Slice(0, length));
Microsoft.AspNetCore.Components (2)
src\Shared\UrlDecoder\UrlDecoder.cs (2)
29return DecodeInPlace(destination.Slice(0, source.Length), isFormEncoding); 363return DecodeInPlace(destination.Slice(0, source.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..]); 68span.CopyTo(_currentBuffer[startIndex..]); 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..]); 68span.CopyTo(_currentBuffer[startIndex..]); 86span.CopyTo(_currentBuffer[startIndex..]); 112? new(_currentBuffer[_nextEndIndex..])
Microsoft.AspNetCore.DataProtection.Abstractions (1)
src\Shared\WebEncoders\WebEncoders.cs (1)
332var base64Url = new string(buffer.Slice(0, numBase64Chars));
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 (1)
src\Shared\WebEncoders\WebEncoders.cs (1)
332var base64Url = new string(buffer.Slice(0, numBase64Chars));
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)
237text.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 (3)
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (1)
65return raw.Slice(pathStartIndex, scan - pathStartIndex);
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (2)
41return UTF8.GetString(unescapedPath.Slice(0, length)); 91return rawPath.Slice(0, writer);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (18)
src\Shared\Http2cat\Http2Utilities.cs (15)
197writableBuffer.Write(buffer.Slice(0, length)); 212writableBuffer.Write(buffer.Slice(0, length)); 283var extendedHeader = buffer.Slice(0, extendedHeaderLength); 285var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 288var padding = buffer.Slice(extendedHeaderLength + length, padLength); 299writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 323var extendedHeader = buffer.Slice(0, extendedHeaderLength); 338writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 367var extendedHeader = buffer.Slice(0, extendedHeaderLength); 371var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); 374var padding = buffer.Slice(extendedHeaderLength + length, padLength); 385writableBuffer.Write(buffer.Slice(0, frame.PayloadLength)); 503await SendAsync(buffer.Span.Slice(0, length)); 568await SendAsync(buffer.Span.Slice(0, length)); 596await 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 (3)
src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (1)
65return raw.Slice(pathStartIndex, scan - pathStartIndex);
src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (2)
41return UTF8.GetString(unescapedPath.Slice(0, length)); 91return rawPath.Slice(0, writer);
Microsoft.AspNetCore.Server.Kestrel.Core (29)
Internal\Http\Http1Connection.cs (4)
282var target = startLine[targetStart..]; 297else if (startLine[targetStart..].GetKnownHttpScheme(out _)) 418var query = target[targetPath.Length..]; 510Span<byte> query = target[targetPath.Length..];
Internal\Http\Http1OutputProducer.cs (1)
785public ReadOnlySpan<byte> Span => Buffer.Span.Slice(0, Length);
Internal\Http\HttpParser.cs (2)
419headerSpan = headerSpan.Slice(0, headerLength); 436if (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\PathNormalizer.cs (3)
35pathLength = RemoveDotSegments(path.Slice(0, pathLength)); 37return Encoding.UTF8.GetString(path.Slice(0, pathLength)); 49return path.Slice(0, pathLength).GetAsciiStringNonNullCharacters();
Internal\Http2\Http2FrameWriter.cs (3)
555_outputWriter.Write(buffer.Slice(0, payloadLength)); 570_outputWriter.Write(buffer.Slice(0, payloadLength)); 784var buffer = _outputWriter.GetSpan(settingsSize).Slice(0, settingsSize); // GetSpan isn't precise
Internal\Http2\Http2Stream.cs (1)
425? stackalloc byte[MaxPathBufferStackAllocSize].Slice(0, pathSegment.Length)
Internal\Http3\Http3Stream.cs (1)
1147? 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\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)
104Assert.False(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, span.Slice(0, span.Length - 1))); 108Assert.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)
34var result = buffer.Slice(0, length).ToArray(); 57var result = buffer.Slice(5, length - 5).ToArray(); 86var result = buffer.Slice(0, length).ToArray(); 128result = buffer.Slice(0, length).ToArray(); 169result = buffer.Slice(0, length).ToArray(); 230var result = buffer.Slice(0, length).ToArray(); 272result = buffer.Slice(0, length).ToArray(); 313result = buffer.Slice(0, length).ToArray(); 551Assert.False(HPackHeaderWriter.BeginEncodeHeaders(statusCode, hpackEncoder, headerEnumerator, payload.Slice(offset, sliceLength), out var length)); 553Assert.Equal(expectedStatusCodePayload, payload.Slice(0, length).ToArray()); 558Assert.False(HPackHeaderWriter.ContinueEncodeHeaders(hpackEncoder, headerEnumerator, payload.Slice(offset, sliceLength), out length)); 560Assert.Equal(expectedDateHeaderPayload, payload.Slice(offset, length).ToArray()); 565Assert.False(HPackHeaderWriter.ContinueEncodeHeaders(hpackEncoder, headerEnumerator, payload.Slice(offset, sliceLength), out length)); 567Assert.Equal(expectedContentTypeHeaderPayload, payload.Slice(offset, length).ToArray()); 572Assert.True(HPackHeaderWriter.ContinueEncodeHeaders(hpackEncoder, headerEnumerator, payload.Slice(offset, sliceLength), out length)); 574Assert.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)
895var target = startLine[targetStart..]; 897var 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)
50writer.Write(buffer.Slice(0, length)); 65writer.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)
50writer.Write(buffer.Slice(0, length)); 65writer.Write(buffer.Slice(0, length));
Microsoft.AspNetCore.Shared.Tests (16)
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)
41return UTF8.GetString(unescapedPath.Slice(0, length)); 91return rawPath.Slice(0, writer);
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));
src\Shared\WebEncoders\WebEncoders.cs (1)
332var base64Url = new string(buffer.Slice(0, numBase64Chars));
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
759? 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 (9)
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));
src\Shared\WebEncoders\WebEncoders.cs (1)
332var base64Url = new string(buffer.Slice(0, numBase64Chars));
Microsoft.Build (4)
FileUtilities.cs (2)
634return str.Slice(0, sliceLength); 647return 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)
634return str.Slice(0, sliceLength); 647return 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)
634return str.Slice(0, sliceLength); 647return hasQuotes ? path.Slice(1, endId - 1) : path;
Microsoft.Build.Utilities.Core (2)
FileUtilities.cs (2)
634return str.Slice(0, sliceLength); 647return hasQuotes ? path.Slice(1, endId - 1) : path;
Microsoft.Extensions.DependencyInjection.Abstractions (3)
ActivatorUtilities.cs (3)
76Span<object?> ctorArgs = values.Slice(0, maxArgs); 77Span<object?> bestCtorArgs = values.Slice(maxArgs, maxArgs); 888return _constructor.Invoker.Invoke(_parameterValues.Slice(0, _constructor.Parameters.Length));
Microsoft.Extensions.Logging.Abstractions (13)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.Extensions.Logging.Console (1)
SimpleConsoleFormatter.cs (1)
96textWriter.Write(span.Slice(0, charsWritten));
Microsoft.Net.Http.Headers (1)
ContentDispositionHeaderValue.cs (1)
563var result = Encoding.UTF8.GetString(buffer.Slice(0, MimePrefix.Length + base64ContentLength + MimeSuffix.Length));
Microsoft.NET.Sdk.WebAssembly.Pack.Tasks (1)
FileHasher.cs (1)
26var dividend = BigInteger.Abs(new BigInteger(hash.AsSpan().Slice(0, 9).ToArray()));
MSBuild (2)
FileUtilities.cs (2)
634return str.Slice(0, sliceLength); 647return hasQuotes ? path.Slice(1, endId - 1) : path;
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 (21)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_chars.Slice(0, _pos).CopyTo(poolArray);
System\ConsolePal.Unix.cs (4)
537bracketPos = readBytes.Slice(0, semiPos).LastIndexOf((byte)'['); 538escPos = readBytes.Slice(0, bracketPos).LastIndexOf(Esc); 543TransferBytes(readBytes.Slice(0, escPos), r); 544TransferBytes(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 (14)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_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.FileVersionInfo (1)
System\Diagnostics\FileVersionInfo.Unix.cs (1)
205parts = parts.Slice(0, versionSpan.Split(parts, '.'));
System.Diagnostics.Process (20)
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 (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_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 (3)
299Span<byte> argRemainder = buffer.Slice(0, bytesRead); 304string? name = GetUntruncatedNameFromArg(argRemainder.Slice(0, argEnd), prefix: stat.comm); 315name = GetUntruncatedNameFromArg(argRemainder.Slice(0, argEnd), prefix: stat.comm);
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)
166accumValueBytes.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)
170temp.Slice(0, byteLen),
System\Formats\Asn1\AsnWriter.Oid.cs (1)
220dest.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)
221buffer.Slice(offset, length).CopyTo(s); 229tempSpan.CopyTo(buffer.Slice(_offset, definiteLength)); 235buffer.Slice(_offset, initialOffset - _offset).Clear();
System.Formats.Tar (61)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_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 (19)
365Span<byte> spanChecksum = buffer.Slice(FieldLocations.Checksum, FieldLengths.Checksum); 377long size = (long)TarHelpers.ParseOctal<ulong>(buffer.Slice(FieldLocations.Size, FieldLengths.Size)); 386name: TarHelpers.GetTrimmedUtf8String(buffer.Slice(FieldLocations.Name, FieldLengths.Name)), 387mode: (int)TarHelpers.ParseOctal<uint>(buffer.Slice(FieldLocations.Mode, FieldLengths.Mode)), 388mTime: TarHelpers.GetDateTimeOffsetFromSecondsSinceEpoch((long)TarHelpers.ParseOctal<ulong>(buffer.Slice(FieldLocations.MTime, FieldLengths.MTime))), 393_uid = (int)TarHelpers.ParseOctal<uint>(buffer.Slice(FieldLocations.Uid, FieldLengths.Uid)), 394_gid = (int)TarHelpers.ParseOctal<uint>(buffer.Slice(FieldLocations.Gid, FieldLengths.Gid)), 395_linkName = TarHelpers.GetTrimmedUtf8String(buffer.Slice(FieldLocations.LinkName, FieldLengths.LinkName)) 430Span<byte> magic = buffer.Slice(FieldLocations.Magic, FieldLengths.Magic); 469Span<byte> version = buffer.Slice(FieldLocations.Version, FieldLengths.Version); 519_uName = TarHelpers.GetTrimmedUtf8String(buffer.Slice(FieldLocations.UName, FieldLengths.UName)); 520_gName = TarHelpers.GetTrimmedUtf8String(buffer.Slice(FieldLocations.GName, FieldLengths.GName)); 527_devMajor = (int)TarHelpers.ParseOctal<uint>(buffer.Slice(FieldLocations.DevMajor, FieldLengths.DevMajor)); 530_devMinor = (int)TarHelpers.ParseOctal<uint>(buffer.Slice(FieldLocations.DevMinor, FieldLengths.DevMinor)); 539long aTime = (long)TarHelpers.ParseOctal<ulong>(buffer.Slice(FieldLocations.ATime, FieldLengths.ATime)); 542long cTime = (long)TarHelpers.ParseOctal<ulong>(buffer.Slice(FieldLocations.CTime, FieldLengths.CTime)); 552_prefix = TarHelpers.GetTrimmedUtf8String(buffer.Slice(FieldLocations.Prefix, FieldLengths.Prefix)); 576span = span.Slice(0, (int)_size); 646span = span.Slice(0, (int)_size);
System\Formats\Tar\TarHeader.Write.cs (27)
528return WriteAsUtf8String(name, buffer.Slice(FieldLocations.Name, FieldLengths.Name)); 547ReadOnlySpan<byte> pathNameBytes = encodingBuffer.Slice(0, encoded); 552return WriteLeftAlignedBytesAndGetChecksum(pathNameBytes, buffer.Slice(FieldLocations.Name, FieldLengths.Name)); 588int checksum = WriteLeftAlignedBytesAndGetChecksum(prefix, buffer.Slice(FieldLocations.Prefix, FieldLengths.Prefix)); 589checksum += WriteLeftAlignedBytesAndGetChecksum(name, buffer.Slice(FieldLocations.Name, FieldLengths.Name)); 609checksum += FormatOctal(_mode, buffer.Slice(FieldLocations.Mode, FieldLengths.Mode)); 614checksum += FormatOctal(_uid, buffer.Slice(FieldLocations.Uid, FieldLengths.Uid)); 619checksum += FormatOctal(_gid, buffer.Slice(FieldLocations.Gid, FieldLengths.Gid)); 626checksum += FormatOctal(_size, buffer.Slice(FieldLocations.Size, FieldLengths.Size)); 640checksum += WriteAsTimestamp(_mTime, buffer.Slice(FieldLocations.MTime, FieldLengths.MTime)); 661checksum += WriteAsUtf8String(linkName, buffer.Slice(FieldLocations.LinkName, FieldLengths.LinkName)); 686int checksum = WriteLeftAlignedBytesAndGetChecksum(UstarMagicBytes, buffer.Slice(FieldLocations.Magic, FieldLengths.Magic)); 687checksum += WriteLeftAlignedBytesAndGetChecksum(UstarVersionBytes, buffer.Slice(FieldLocations.Version, FieldLengths.Version)); 694int checksum = WriteLeftAlignedBytesAndGetChecksum(GnuMagicBytes, buffer.Slice(FieldLocations.Magic, FieldLengths.Magic)); 695checksum += WriteLeftAlignedBytesAndGetChecksum(GnuVersionBytes, buffer.Slice(FieldLocations.Version, FieldLengths.Version)); 719checksum += WriteAsUtf8String(uName, buffer.Slice(FieldLocations.UName, FieldLengths.UName)); 737checksum += WriteAsUtf8String(gName, buffer.Slice(FieldLocations.GName, FieldLengths.GName)); 742checksum += FormatOctal(_devMajor, buffer.Slice(FieldLocations.DevMajor, FieldLengths.DevMajor)); 747checksum += FormatOctal(_devMinor, buffer.Slice(FieldLocations.DevMinor, FieldLengths.DevMinor)); 756int checksum = WriteAsTimestamp(_aTime, buffer.Slice(FieldLocations.ATime, FieldLengths.ATime)); 757checksum += WriteAsTimestamp(_cTime, buffer.Slice(FieldLocations.CTime, FieldLengths.CTime)); 761checksum += WriteLeftAlignedBytesAndGetChecksum(_gnuUnusedBytes, buffer.Slice(FieldLocations.GnuUnused, FieldLengths.AllGnuUnused)); 783zeros = zeros.Slice(0, paddingAfterData); 876dataStream.Write(span.Slice(0, bytesWritten)); 955Span<byte> destination = buffer.Slice(FieldLocations.Checksum, FieldLengths.Checksum); 1010destination.Slice(0, copyPos).Fill((byte)'0'); 1054return WriteLeftAlignedBytesAndGetChecksum(buffer.Slice(0, encoded), buffer);
System.IO.Compression (4)
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\ZipCustomStreams.cs (1)
323int ret = _superStream.Read(destination.Slice(0, count));
System.IO.Compression.Brotli (2)
System\IO\Compression\enc\BrotliStream.Compress.cs (2)
78_stream.Write(output.Slice(0, bytesWritten)); 186_stream.Write(output.Slice(0, bytesWritten));
System.IO.FileSystem.Watcher (13)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_chars.Slice(0, _pos).CopyTo(poolArray);
System.IO.Hashing (4)
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (4)
209GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 233GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 271GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 295GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
System.IO.MemoryMappedFiles (1)
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (1)
265guid.Slice(0, MaxNameLength - NamePrefix.Length).CopyTo(span.Slice(NamePrefix.Length));
System.Linq (1)
System\Linq\SegmentedArrayBuilder.cs (1)
306_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 (44)
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 (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_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)
434string response = Encoding.ASCII.GetString(_incomingBuffer.ActiveSpan.Slice(0, Math.Min(20, _incomingBuffer.ActiveLength))); 658GetFrameData(_incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength), frameHeader.PaddedFlag, frameHeader.PriorityFlag), 674_incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength), 742ReadOnlySpan<byte> span = _incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength); 775ReadOnlySpan<byte> frameData = GetFrameData(_incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength), hasPad: frameHeader.PaddedFlag, hasPriority: false); 829ReadOnlySpan<byte> settings = _incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength); 983ReadOnlySpan<byte> pingContent = _incomingBuffer.ActiveSpan.Slice(0, FrameHeader.PingLength);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (1)
422return buffer.Slice(0, 4 + integerLength).ToArray();
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (5)
647int actualHeadersLengthEncodedSize = VariableLengthIntegerHelper.WriteInteger(_sendBuffer.ActiveSpan.Slice(1, headersLengthEncodedSize), headersLength); 887_headerDecoder.Decode(_recvBuffer.ActiveSpan.Slice(0, processLength), endHeaders, this); 1116_recvBuffer.ActiveSpan.Slice(0, copyLen).CopyTo(buffer); 1136int bytesRead = _stream.Read(buffer.Slice(0, copyLen)); 1188_recvBuffer.ActiveSpan.Slice(0, copyLen).CopyTo(buffer.Span);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (5)
1005ParseStatusLineCore(buffer.Slice(0, length), response); 1056throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_code, Encoding.ASCII.GetString(line.Slice(9, 3)))); 1167ReadOnlySpan<byte> headerName = buffer.Slice(0, valueStartIdx - 1); 1168ReadOnlySpan<byte> headerValue = buffer.Slice(valueStartIdx, buffer.Length - valueIterator.Length + crOrLfIdx - valueStartIdx); 1495return 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 (13)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_chars.Slice(0, _pos).CopyTo(poolArray);
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)
300return CreatePingReply(IPStatus.TtlExpired, IPEndPointExtensions.GetIPAddress(socketAddress.Slice(0, header.SocketAddressLen)));
System.Net.Primitives (4)
src\libraries\Common\src\System\Net\SocketAddress.cs (1)
198return result.Slice(0, length).ToString();
System\Net\CookieContainer.cs (1)
612ipParts = ipParts.Slice(0, hostSpan.Split(ipParts, '.'));
System\Net\IPAddress.cs (2)
415_toString = toString = new string(span.Slice(0, length)); 472if (tmpDestination.Slice(0, written).TryCopyTo(destination))
System.Net.Quic (1)
System\Net\Quic\Internal\ReceiveBuffers.cs (1)
58quicBuffer = quicBuffer.Slice(0, totalLength);
System.Net.Security (21)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (2)
410if (!Ssl.SslAddClientCAs(sslHandle, handles.Slice(0, certList.Count))) 672Span<byte> clientProto = clientList.Slice(1, length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (1)
224Span<byte> buffer = 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)
1021NetEventSource.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); 172_rightEndPoint = new UnixDomainSocketEndPoint(buffer.Slice(0, bufferLength)); 191new IPAddress((long)SocketAddressPal.GetIPv4Address(buffer.Slice(0, bufferLength)) & 0x0FFFFFFFF), 197SocketAddressPal.GetIPv6Address(buffer.Slice(0, bufferLength), address, out uint scope); 204_remoteEndPoint = new UnixDomainSocketEndPoint(buffer.Slice(0, bufferLength)); 319_localEndPoint = IPEndPointExtensions.CreateIPEndPoint(buffer.Slice(0, size)); 324buffer.Slice(0, size).CopyTo(socketAddress.Buffer.Span); 365_remoteEndPoint = IPEndPointExtensions.CreateIPEndPoint(buffer.Slice(0, size)); 370buffer.Slice(0, size).CopyTo(socketAddress.Buffer.Span); 781socketAddress.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)
183url = url.Slice(0, charsWritten);
System.Net.WebSockets (10)
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 (8)
833_receiveBuffer.Span.Slice(_receiveBufferOffset, receiveBufferBytesToCopy).CopyTo( 858_inflater!.Span.Slice(0, totalBytesReceived) : 859payloadBuffer.Span.Slice(0, totalBytesReceived), header.Mask, _receivedMaskOffsetOffset); 884!TryValidateUtf8(payloadBuffer.Span.Slice(0, totalBytesReceived), header.EndOfMessage, _utf8TextState)) 976ApplyMask(_receiveBuffer.Span.Slice(_receiveBufferOffset, (int)header.PayloadLength), header.Mask, 0); 989closeStatusDescription = s_textEncoding.GetString(_receiveBuffer.Span.Slice(_receiveBufferOffset + 2, (int)header.PayloadLength - 2)); 1054ApplyMask(_receiveBuffer.Span.Slice(_receiveBufferOffset, (int)header.PayloadLength), header.Mask, 0); 1418_receiveBuffer.Span.Slice(_receiveBufferOffset, _receiveBufferCount).CopyTo(_receiveBuffer.Span);
System.Net.WebSockets.Client (2)
System\Net\WebSockets\WebSocketHandle.Managed.cs (2)
494string secKey = Convert.ToBase64String(bytes.Slice(0, 16 /*sizeof(Guid)*/)); 507Convert.ToBase64String(bytes.Slice(0, bytesWritten)));
System.Private.CoreLib (136)
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 (2)
49return GetAndTrimString(stackBuffer.Slice(0, length)); 84return buffer.Slice(0, length).ToString();
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
252parts = parts.Slice(0, attributeValueSpan.Split(parts, '.'));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_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)
2692new 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\Base64Decoder.cs (1)
525status = DecodeFromUtf8(buffer.Slice(0, bufferIdx), bytes, out int localConsumed, out int localWritten, localIsFinalBlock, ignoreWhiteSpace: false);
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)); 705InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 711HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 716int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 934InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 940HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 945int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize));
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (4)
1261new BitHelper(span.Slice(0, intArrayLength), clear: true) : 1329new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) : 1334new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) : 1417new BitHelper(span.Slice(0, intArrayLength), clear: true) :
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
98_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 113return span.Slice(pos, length); 127return _span.Slice(pos, length); 143return _span.Slice(0, _pos); 148if (_span.Slice(0, _pos).TryCopyTo(destination))
src\libraries\System.Private.CoreLib\src\System\Convert.cs (2)
2731tempBuffer = tempBuffer.Slice(0, charsWritten); 3013destination = destination.Slice(0, destination.Length - 1);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
5579Span<char> hexValueFormatted = ulongHexScratch.Slice(0, charsWritten); 5626Span<char> keywordFormatted = ulongHexScratch.Slice(0, charsWritten);
src\libraries\System.Private.CoreLib\src\System\Enum.cs (2)
1947foundItems = foundItems.Slice(0, foundItemsCount); 1991foundItems = 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)
165return IsSortable(valueAsUtf16.Slice(0, charCount)); 1048return IndexOf(source, valueAsUtf16.Slice(0, charCount), options); 1424return LastIndexOf(source, valueAsUtf16.Slice(0, charCount), options);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (1)
942int hash = Marvin.ComputeHash32(sortKey.Slice(0, sortKeyLength), Marvin.DefaultSeed);
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)
95return changed ? new string(buffer.Slice(0, bufferIndex)) : name; 389return 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)
80ReadOnlySpan<char> result = buffer.Slice(0, realLen);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (1)
92ReadOnlySpan<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 (3)
36Span<byte> path = totalByteCount <= 256 ? stackalloc byte[256].Slice(0, totalByteCount) : new byte[totalByteCount]; 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)
1255return buffer.Slice(0, bytesRead).ToArray(); 1309Span<byte> toStore = bytes.Slice(0, preambleSize + encoded);
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (2)
111Span<byte> path = totalByteCount <= 256 ? stackalloc byte[256].Slice(0, totalByteCount) : new byte[totalByteCount]; 127return Encoding.UTF8.GetString(path.Slice(0, path.Length - 1)); // trim off the trailing '\0'
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (6)
3879Span<Range> destinationMinusOne = destination.Slice(0, destination.Length - 1); 4509_destination.Slice(_pos, paddingRequired).Fill(' '); 4514_destination.Slice(_pos, paddingRequired).Fill(' '); 4627_destination.Slice(_pos, paddingNeeded).Fill(' '); 4631_destination.Slice(startingPos, charsWritten).CopyTo(_destination.Slice(startingPos + paddingNeeded)); 4632_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 (1)
213randomBytes = randomBytes.Slice(0, destination.Length);
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\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)
130internal ReadOnlySpan<char> Text => _chars.Slice(0, _pos); 424_chars.Slice(_pos, paddingRequired).Fill(' '); 429_chars.Slice(_pos, paddingRequired).Fill(' '); 558_chars.Slice(_pos, paddingNeeded).Fill(' '); 562_chars.Slice(startingPos, charsWritten).CopyTo(_chars.Slice(startingPos + paddingNeeded)); 563_chars.Slice(startingPos, paddingNeeded).Fill(' '); 635_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)
233seenValues = 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)
217original = original.Slice(0, charCount); 218modified = modified.Slice(0, charCount);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (1)
1420return Insert(index, buffer.Slice(0, charsWritten), 1);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (5)
679AppendFormatted(utf16.Slice(0, charsWritten)) : 726AppendFormatted(utf16.Slice(0, charsWritten)) : 788_destination.Slice(_pos, paddingNeeded).Fill((byte)' '); 792_destination.Slice(startingPos, bytesWritten).CopyTo(_destination.Slice(startingPos + paddingNeeded)); 793_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)
171stackScratch.Slice(0, inHandles.Length) :
System.Private.CoreLib.Generators (5)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
98_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 113return span.Slice(pos, length); 127return _span.Slice(pos, length); 143return _span.Slice(0, _pos); 148if (_span.Slice(0, _pos).TryCopyTo(destination))
System.Private.Uri (20)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_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)
183Span<byte> encodedBytes = maxUtf8EncodedSpan.Slice(0, bytesWritten);
System\Uri.cs (3)
4403dest.Length = offset + Compress(dest.RawChars.Slice(offset, dest.Length - offset), _syntax); 4606span = span.Slice(0, span.Length - (lastSlash - i - 1)); 4634span = span.Slice(0, span.Length - (lastSlash - i));
System\UriHelper.cs (1)
263foreach (byte b in utf8Bytes.Slice(0, bytesWritten))
System.Private.Xml (17)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_chars.Slice(0, _pos).CopyTo(poolArray);
System\Xml\Cache\XPathDocumentNavigator.cs (1)
925return buf.Slice(0, idx).ToString();
System\Xml\Schema\XsdDateTime.cs (1)
503return 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 (14)
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
252parts = parts.Slice(0, attributeValueSpan.Split(parts, '.'));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_chars.Slice(0, _pos).CopyTo(poolArray);
System.Runtime.Numerics (148)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_chars.Slice(0, _pos).CopyTo(poolArray);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
98_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 113return span.Slice(pos, length); 127return _span.Slice(pos, length); 143return _span.Slice(0, _pos); 148if (_span.Slice(0, _pos).TryCopyTo(destination))
System\Number.BigInteger.cs (10)
438Span<uint> newBuffer = MemoryMarshal.Cast<int, uint>(arrayFromPoolForResultBuffer).Slice(0, bufferSize); 490Span<uint> multiplier = MemoryMarshal.Cast<int, uint>(arrayFromPoolForMultiplier).Slice(0, blockSize); 514BigIntegerCalculator.Multiply(multiplier, curBuffer.Slice(blockSize, upperLen), curNewBuffer.Slice(0, len)); 552Span<uint> newMultiplier = MemoryMarshal.Cast<int, uint>(arrayFromPoolForMultiplier).Slice(0, blockSize); 573currentBuffer = buffer.Slice(0, currentBufferSize); 617bits = currentBuffer.Slice(0, currentBufferSize).ToArray(); 626Span<uint> curBits = currentBuffer.Slice(0, currentBufferSize); 674bits = bits.Slice(0, bytesWrittenOrNeeded); 755bytes = bytes.Slice(0, bytesWrittenOrNeeded);
System\Numerics\BigInteger.cs (52)
574value = value.Slice(0, dwordCount); 607_bits = value.Slice(0, len).ToArray(); 769: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 799: remainderFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 805: quotientFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 922: bitsFromPool = ArrayPool<uint>.Shared.Rent(leftBits.Length)).Slice(0, leftBits.Length); 935: bitsFromPool = ArrayPool<uint>.Shared.Rent(leftBits.Length)).Slice(0, leftBits.Length); 990: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1050: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1061: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1519buffer = buffer.Slice(0, _bits.Length + 1); 1522NumericsHelpers.DangerousMakeTwosComplement(buffer.Slice(0, buffer.Length - 1)); // Mutates dwords 1543buffer = buffer.Slice(0, count); 1651: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1663: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1675: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1687: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1729: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1741: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1751: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1763: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2340: leftBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2341x = x.Slice(0, left.WriteTo(x)); 2347: rightBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2348y = y.Slice(0, right.WriteTo(y)); 2354: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2396: leftBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2397x = x.Slice(0, left.WriteTo(x)); 2403: rightBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2404y = y.Slice(0, right.WriteTo(y)); 2410: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2447: leftBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2448x = x.Slice(0, left.WriteTo(x)); 2454: rightBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2455y = y.Slice(0, right.WriteTo(y)); 2461: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2501: xdFromPool = ArrayPool<uint>.Shared.Rent(xl)).Slice(0, xl); 2508: zdFromPool = ArrayPool<uint>.Shared.Rent(zl)).Slice(0, zl); 2562: xdFromPool = ArrayPool<uint>.Shared.Rent(xl)).Slice(0, xl); 2590: zdFromPool = ArrayPool<uint>.Shared.Rent(zl)).Slice(0, zl); 2704: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2716: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2726: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2738: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2751: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2793: quotientFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2819: quotientFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2869: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 3254xd = xd.Slice(0, xl); 3264zd = zd.Slice(0, zl); 3389xd = xd.Slice(0, xl); 3399zd = zd.Slice(0, zl);
System\Numerics\BigIntegerCalculator.DivRem.cs (1)
91: leftCopyFromPool = ArrayPool<uint>.Shared.Rent(left.Length)).Slice(0, left.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 (38)
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); 240: tempFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length); 270: valueCopyFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 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)
54return ActualLength(bits.Slice(0, modulus.Length));
System.Security.Cryptography (106)
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)
222p.Slice(0, len).CopyTo(retSpan);
src\libraries\Common\src\System\Security\Cryptography\ECDsaOpenSsl.cs (2)
188return destination.Slice(0, actualLength); 226toVerify = derSignature.Slice(0, derSize);
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (10)
192buf = buf.Slice(0, byteCount); 202buf = buf.Slice(0, written); 482buf = buf.Slice(0, byteCount); 492buf = buf.Slice(0, written); 667iv = iv.Slice(0, rc2Parameters.Iv.Length); 716iv = iv.Slice(0, bytesWritten); 848Span<byte> k = dk.Slice(0, 8); 849Span<byte> iv = dk.Slice(8, 8); 1004t = t.Slice(0, tLength); 1019t.Slice(0, dk.Length).CopyTo(dk);
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (2)
203hashBuf.Slice(0, destination.Length).CopyTo(destination); 289Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length));
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (3)
100return destination.Slice(0, bytesWritten).ToArray(); 146tmp.Slice(0, written).CopyTo(destination); 153CryptographicOperations.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); 409destination.Slice(0, destination.Length - emLen).Clear(); 412Span<byte> em = destination.Slice(destination.Length - emLen, emLen); 416Span<byte> db = em.Slice(0, dbLen); 417Span<byte> hDest = em.Slice(dbLen, hLen); 446db.Slice(0, psLen).Clear(); 620tmp.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\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_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 (4)
59prk = prk.Slice(0, hashLength); 152tempInfoBuffer = tempInfoBuffer.Slice(0, info.Length); 172t = remainingOutput.Slice(0, hashLength); 183lastChunk.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)
175return destination.Slice(0, size);
System\Security\Cryptography\RandomNumberGenerator.cs (3)
322Span<byte> remainingRandom = randomBuffer.Slice(0, Math.Min(RandomBufferSize, needed)); 342remainingRandom = randomBuffer.Slice(0, Math.Min(RandomBufferSize, needed)); 370randomBytes = randomBytes.Slice(0, destination.Length);
System\Security\Cryptography\RandomNumberGeneratorImplementation.cs (1)
89remainder.Slice(0, next0Byte).CopyTo(data.Slice(first0Byte));
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
294uiSpan = 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)
735byte[] plaintext = decryptBuffer.Slice(0, written).ToArray(); 736CryptographicOperations.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)
32Span<byte> transformBuffer = output.Slice(0, bytesTransformed); 80stackBuffer.Slice(0, stackTransformFinal), 83Span<byte> writtenDepadded = stackBuffer.Slice(0, depaddedLength); 131stackBuffer.Slice(0, finalTransformWritten), 134Span<byte> depaddedFinalTransform = stackBuffer.Slice(0, depaddedLength); 139CryptographicOperations.ZeroMemory(output.Slice(0, writtenToOutput)); 151CryptographicOperations.ZeroMemory(output.Slice(0, writtenToOutput)); 152CryptographicOperations.ZeroMemory(stackBuffer.Slice(0, finalTransformWritten)); 169decryptedBuffer = buffer.Slice(0, transformWritten); 183decryptedBuffer.Slice(0, unpaddedLength).CopyTo(output); 218Span<byte> paddedOutput = output.Slice(0, padWritten);
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (1)
732return Encoding.UTF8.GetString(buffer.Slice(0, total));
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (1)
287tempChain = tempChain.Slice(0, chainSize);
System\Security\Cryptography\X509Certificates\X500NameEncoder.cs (1)
492data = destination.Slice(0, written);
System\Security\Cryptography\X509Certificates\X509AuthorityKeyIdentifierExtension.cs (1)
256encoded = stackSpan.Slice(0, written);
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (3)
212return hash.Slice(0, TruncateSize).ToArray(); 229int hashWritten = CryptographicOperations.HashData(hashAlgorithmName, spkiBuffer.Slice(0, spkiWritten), hash); 236return hash.Slice(0, hashWritten).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)
421hasher.AppendData(buffer.Slice(0, bytesWritten));
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (4)
391WriteCoseSignaturesArray(writer, signer, buffer.Slice(protectedMapBytesWritten), buffer.Slice(0, protectedMapBytesWritten), associatedData, content, contentStream); 463AppendToBeSigned(buffer, hasher, SigStructureContext.Signature, bodyProtected, buffer.Slice(0, signProtectedBytesWritten), associatedData, content, contentStream); 799byte[] encodedSignProtected = bufferSpan.Slice(0, bytesWritten).ToArray(); 806byte[] signature = bufferSpan.Slice(0, bytesWritten).ToArray();
System\Security\Cryptography\Cose\CoseSign1Message.cs (1)
336AppendToBeSigned(buffer, hasher, SigStructureContext.Signature1, buffer.Slice(0, protectedMapBytesWritten), ReadOnlySpan<byte>.Empty, associatedData, contentBytes, contentStream);
System.Text.Encodings.Web (17)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_chars.Slice(0, _pos).CopyTo(poolArray);
System\Text\Encodings\Web\DefaultHtmlEncoder.cs (2)
117destination = destination.Slice(3, idxOfSemicolon - 3); 194destination = destination.Slice(3, idxOfSemicolon - 3);
System\Text\Encodings\Web\OptimizedInboxTextEncoder.Ascii.cs (1)
104encodedCharCount = innerEncoder.EncodeUtf16(rune, tempBuffer.Slice(0, 6));
System\Text\Encodings\Web\TextEncoder.cs (1)
62utf16ScratchBuffer = utf16ScratchBuffer.Slice(0, charsWritten);
System.Text.Json (120)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_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)
136string result = destination.Slice(0, charsWritten).ToString(); 140destination.Slice(0, charsWritten).Clear(); 165destination.Slice(0, charsWritten).Clear();
System\Text\Json\Document\JsonDocument.cs (2)
307result = TextEquals(index, otherUtf8Text.Slice(0, written), isPropertyName, shouldUnescape: true); 312otherUtf8Text.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)
93utf8Bytes = 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)
253path.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 (8)
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); 170bytes = utf8Unescaped.Slice(0, bytesWritten).ToArray(); 198bytes = byteSpan.Slice(0, bytesWritten).ToArray();
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (1)
627throw 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 (2)
381ReadOnlySpan<char> source = charBuffer.Slice(0, charsWritten); 399charBuffer.Slice(0, charsWritten).Clear();
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (5)
46byteBuffer = byteBuffer.Slice(0, written); 71writer.WriteRawValue(buffer.Slice(0, written)); 88writer.WritePropertyName(buffer.Slice(0, written)); 134writer.WriteRawValue(buffer.Slice(0, length)); 151return JsonReaderHelper.TryGetFloatingPointConstant(buffer.Slice(0, written), out value);
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (3)
51if (!TryParse(buffer.Slice(0, written), out Int128 result)) 76writer.WriteRawValue(buffer.Slice(0, written)); 123writer.WriteRawValue(buffer.Slice(0, length));
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (3)
49source = stackSpan.Slice(0, bytesWritten); 84writer.WriteStringValue(output.Slice(0, bytesWritten)); 94writer.WritePropertyName(output.Slice(0, bytesWritten));
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (3)
49source = stackSpan.Slice(0, bytesWritten); 82writer.WriteStringValue(output.Slice(0, bytesWritten)); 92writer.WritePropertyName(output.Slice(0, bytesWritten));
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (3)
50if (!TryParse(buffer.Slice(0, written), out UInt128 result)) 75writer.WriteRawValue(buffer.Slice(0, written)); 122writer.WriteRawValue(buffer.Slice(0, length));
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (3)
45ReadOnlySpan<char> source = charBuffer.Slice(0, bytesWritten); 95writer.WriteStringValue(span.Slice(0, charsWritten)); 121writer.WritePropertyName(span.Slice(0, charsWritten));
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
444utf8 = utf8.Slice(0, actualByteCount); 475utf8 = 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)
723WriteStartByOptions(escapedPropertyName.Slice(0, written), token); 878WriteStartByOptions(escapedPropertyName.Slice(0, written), token);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (2)
152WriteBase64ByOptions(escapedPropertyName.Slice(0, written), bytes); 175WriteBase64ByOptions(escapedPropertyName.Slice(0, written), bytes);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (3)
159WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 182WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 386WritePropertyNameUnescaped(buffer.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (3)
158WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 181WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 385WritePropertyNameUnescaped(buffer.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (3)
158WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 181WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 374WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (3)
162WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 185WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 379WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (3)
162WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 185WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 378WritePropertyNameUnescaped(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)
158WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 181WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 390WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (3)
280WriteLiteralByOptions(escapedPropertyName.Slice(0, written), value); 303WriteLiteralByOptions(escapedPropertyName.Slice(0, written), value); 526WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (3)
234WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 257WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 455WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (4)
924WriteStringByOptions(escapedPropertyName, escapedValue.Slice(0, written)); 947WriteStringByOptions(escapedPropertyName, escapedValue.Slice(0, written)); 970WriteStringByOptions(escapedPropertyName.Slice(0, written), escapedValue); 993WriteStringByOptions(escapedPropertyName.Slice(0, written), escapedValue);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (3)
243WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 266WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 464WritePropertyNameUnescaped(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)
218utf8Json = 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.UnsignedNumber.cs (1)
117WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System.Text.Json.SourceGeneration (3)
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
136string result = destination.Slice(0, charsWritten).ToString(); 140destination.Slice(0, charsWritten).Clear(); 165destination.Slice(0, charsWritten).Clear();
System.Text.RegularExpressions (24)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_chars.Slice(0, _pos).CopyTo(poolArray);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
98_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 113return span.Slice(pos, length); 127return _span.Slice(pos, length); 143return _span.Slice(0, _pos); 148if (_span.Slice(0, _pos).TryCopyTo(destination))
System\Text\RegularExpressions\RegexCharClass.cs (1)
1972Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
103chars = scratch.Slice(0, scratchCount).ToArray();
System\Text\RegularExpressions\RegexNode.cs (1)
1453return 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 (27)
RegexGenerator.Emitter.cs (3)
527helperName = $"IndexOfAny{(negatedCategory ? "Except" : "")}{string.Concat(categories.Slice(0, numCategories).ToArray().Select(c => c.ToString()))}"; 1713foreach (char c in setChars.Slice(0, numChars)) 1775writer.WriteLine($"case {string.Join(" or ", setChars.Slice(0, numChars).ToArray().Select(Literal))}:");
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (13)
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); 246Span<char> dst = _chars.Slice(_pos, length); 276return _chars.Slice(origPos, length); 312_chars.Slice(0, _pos).CopyTo(poolArray);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
98_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 113return span.Slice(pos, length); 127return _span.Slice(pos, length); 143return _span.Slice(0, _pos); 148if (_span.Slice(0, _pos).TryCopyTo(destination))
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (1)
1972Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
103chars = scratch.Slice(0, scratchCount).ToArray();
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (1)
1453return 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));