2393 references to Slice
aspire (12)
src\Shared\CircularBuffer.cs (5)
102data.Slice(0, _end).CopyTo(data.Slice(1)); 110data.Slice(internalIndex, shiftLength).CopyTo(data.Slice(internalIndex + 1)); 113data.Slice(0, _end).CopyTo(data.Slice(1)); 119data.Slice(internalIndex, _end - internalIndex).CopyTo(data.Slice(internalIndex + 1)); 123data.Slice(internalIndex, data.Length - internalIndex - 1).CopyTo(data.Slice(internalIndex + 1));
src\Shared\Otlp\OtlpHelpers.cs (1)
112instanceId = chars.Slice(charsWritten - 8, 8).ToString();
Utils\ReparsePoint.cs (6)
441System.Buffers.Binary.BinaryPrimitives.WriteUInt16LittleEndian(span.Slice(4, 2), (ushort)reparseDataLength); 450System.Buffers.Binary.BinaryPrimitives.WriteUInt16LittleEndian(span.Slice(8, 2), (ushort)subNameOffset); 451System.Buffers.Binary.BinaryPrimitives.WriteUInt16LittleEndian(span.Slice(10, 2), (ushort)subNameLength); 452System.Buffers.Binary.BinaryPrimitives.WriteUInt16LittleEndian(span.Slice(12, 2), (ushort)printNameOffset); 453System.Buffers.Binary.BinaryPrimitives.WriteUInt16LittleEndian(span.Slice(14, 2), (ushort)printNameLength); 455subNameBytes.CopyTo(span[pathOffset..]);
Aspire.Dashboard (7)
src\Shared\CircularBuffer.cs (5)
102data.Slice(0, _end).CopyTo(data.Slice(1)); 110data.Slice(internalIndex, shiftLength).CopyTo(data.Slice(internalIndex + 1)); 113data.Slice(0, _end).CopyTo(data.Slice(1)); 119data.Slice(internalIndex, _end - internalIndex).CopyTo(data.Slice(internalIndex + 1)); 123data.Slice(internalIndex, data.Length - internalIndex - 1).CopyTo(data.Slice(internalIndex + 1));
src\Shared\CompareHelpers.cs (1)
25(requestPooled = ArrayPool<byte>.Shared.Rent(requestByteCount))).Slice(0, requestByteCount);
src\Shared\Otlp\OtlpHelpers.cs (1)
112instanceId = chars.Slice(charsWritten - 8, 8).ToString();
Aspire.Hosting (7)
src\Shared\CircularBuffer.cs (5)
102data.Slice(0, _end).CopyTo(data.Slice(1)); 110data.Slice(internalIndex, shiftLength).CopyTo(data.Slice(internalIndex + 1)); 113data.Slice(0, _end).CopyTo(data.Slice(1)); 119data.Slice(internalIndex, _end - internalIndex).CopyTo(data.Slice(internalIndex + 1)); 123data.Slice(internalIndex, data.Length - internalIndex - 1).CopyTo(data.Slice(internalIndex + 1));
src\Shared\CompareHelpers.cs (1)
25(requestPooled = ArrayPool<byte>.Shared.Rent(requestByteCount))).Slice(0, requestByteCount);
src\Shared\PasswordGenerator.cs (1)
84RandomNumberGenerator.GetItems(choices, destination.Slice(0, minValues));
Aspire.Playground.Tests (1)
src\Shared\PasswordGenerator.cs (1)
84RandomNumberGenerator.GetItems(choices, destination.Slice(0, minValues));
GenerateDocumentationAndConfigFiles (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
141tempBuffer = tempBuffer.Slice(0, charsWritten);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (2)
103var contentHash = bytes[HashIndex..HashSize].ToImmutableArray(); 104var position = BinaryPrimitives.ReadInt32LittleEndian(bytes[PositionIndex..]);
ILCompiler.Compiler (97)
Compiler\UnixNodeMangler.cs (1)
30return Utf8String.Concat("_ZTV"u8, typeNameLengthStr.Slice(0, written), mangledJustTypeName.AsSpan());
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\CoffObjectWriter.cs (3)
611buffer.Slice(nameBytes, 8 - nameBytes).Clear(); 774buffer.Slice(Name.Length, 8 - Name.Length).Clear(); 780BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), stringTable.GetStringOffset(Name));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (2)
91bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill(0x80); 103bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill((byte)(padValue | 0x80));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (1)
973Magic.CopyTo(buffer.Slice(0, Magic.Length));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\MachObjectWriter.cs (62)
1024BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), MH_MAGIC_64); 1025BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), (uint)CpuType); 1026BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(8, 4), CpuSubType); 1027BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(12, 4), FileType); 1028BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(16, 4), NumberOfCommands); 1029BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(20, 4), SizeOfCommands); 1030BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(24, 4), Flags); 1031BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(28, 4), Reserved); 1055BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), LC_SEGMENT_64); 1056BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), (uint)(HeaderSize + NumberOfSections * MachSection.HeaderSize)); 1057bool encoded = Encoding.UTF8.TryGetBytes(Name, buffer.Slice(8, 16), out _); 1059BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(24, 8), Address); 1060BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(32, 8), Size); 1061BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(40, 8), FileOffset); 1062BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(48, 8), FileSize); 1063BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(56, 4), MaximumProtection); 1064BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(60, 4), InitialProtection); 1065BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(64, 4), NumberOfSections); 1066BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(68, 4), Flags); 1141bool encoded = Encoding.UTF8.TryGetBytes(SectionName, buffer.Slice(0, 16), out _); 1143encoded = Encoding.UTF8.TryGetBytes(SegmentName, buffer.Slice(16, 16), out _); 1145BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(32, 8), VirtualAddress); 1146BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(40, 8), Size); 1147BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(48, 4), FileOffset); 1148BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(52, 4), Log2Alignment); 1149BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(56, 4), RelocationOffset); 1150BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(60, 4), NumberOfRelocationEntries); 1151BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(64, 4), Flags); 1193BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), nameIndex); 1196BinaryPrimitives.WriteUInt16LittleEndian(buffer.Slice(6, 2), Descriptor); 1216BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), LC_SYMTAB); 1217BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), (uint)HeaderSize); 1218BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(8, 4), SymbolTableOffset); 1219BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(12, 4), NumberOfSymbols); 1220BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(16, 4), StringTableOffset); 1221BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(20, 4), StringTableSize); 1254BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), LC_DYSYMTAB); 1255BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), (uint)HeaderSize); 1256BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(8, 4), LocalSymbolsIndex); 1257BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(12, 4), LocalSymbolsCount); 1258BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(16, 4), ExternalSymbolsIndex); 1259BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(20, 4), ExternalSymbolsCount); 1260BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(24, 4), UndefinedSymbolsIndex); 1261BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(28, 4), UndefinedSymbolsCount); 1262BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(32, 4), TableOfContentsOffset); 1263BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(36, 4), TableOfContentsCount); 1264BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(40, 4), ModuleTableOffset); 1265BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(44, 4), ModuleTableCount); 1266BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(48, 4), ExternalReferenceTableOffset); 1267BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(52, 4), ExternalReferenceTableCount); 1268BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(56, 4), IndirectSymbolTableOffset); 1269BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(60, 4), IndirectSymbolTableCount); 1270BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(64, 4), ExternalRelocationTableOffset); 1271BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(68, 4), ExternalRelocationTableCount); 1272BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(72, 4), LocalRelocationTableOffset); 1273BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(76, 4), LocalRelocationTableCount); 1291BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), LC_BUILD_VERSION); 1292BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), (uint)HeaderSize); 1293BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(8, 4), Platform); 1294BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(12, 4), MinimumPlatformVersion); 1295BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(16, 4), SdkVersion); 1296BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(20, 4), 0); // No tools
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (1)
713return buffer.Slice(0, bytesWritten);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (1)
58_appendBuffer.GetSpan(paddingLength).Slice(0, paddingLength).Fill(_padding[0]);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionWriter.cs (1)
84buffer.Slice(0, size).Clear();
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\StringTableBuilder.cs (2)
112MultiKeySort(input.Slice(0, l), pos); 119input = input.Slice(l, h - l);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmInstructions.cs (8)
114WasmExpr.OffsetRelocationsByOffset(buffer.Slice(0, relocsEncoded), bodySizePrefixLength + _locals.Length); 219int adjustSize = expr.Encode(buffer.Slice(pos, encodeSizeExpected)); 258WasmExpr.OffsetRelocationsByOffset(buffer.Slice(totalRelocsEncoded, relocsEncoded), offset); 354DwarfHelper.WritePaddedULEB128(buffer.Slice(0, relocSize), 0); 359DwarfHelper.WritePaddedSLEB128(buffer.Slice(0, relocSize), 0); 415WasmExpr.OffsetRelocationsByOffset(buffer.Slice(0, relocsEncoded), base.EncodeSize() + (int)DwarfHelper.SizeOfULEB128(_align)); 472DwarfHelper.WritePaddedULEB128(buffer.Slice(pos, relocSize), 0); 508WasmExpr.OffsetRelocationsByOffset(buffer.Slice(0, relocsEncoded), base.EncodeSize());
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8StringBuilder.cs (1)
99buffer.Slice(0, bytesWritten).CopyTo(_buffer.AsSpan(_length));
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoTypes.cs (4)
1661return LoweredElements.Slice(0, (int)numLoweredElements).SequenceEqual(other.LoweredElements.Slice(0, (int)other.numLoweredElements)) 1662&& Offsets.Slice(0, (int)numLoweredElements).SequenceEqual(other.Offsets.Slice(0, (int)other.numLoweredElements));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
ILCompiler.ReadyToRun (101)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\CoffObjectWriter.cs (3)
611buffer.Slice(nameBytes, 8 - nameBytes).Clear(); 774buffer.Slice(Name.Length, 8 - Name.Length).Clear(); 780BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), stringTable.GetStringOffset(Name));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (2)
91bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill(0x80); 103bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill((byte)(padValue | 0x80));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (1)
973Magic.CopyTo(buffer.Slice(0, Magic.Length));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\MachObjectWriter.cs (62)
1024BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), MH_MAGIC_64); 1025BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), (uint)CpuType); 1026BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(8, 4), CpuSubType); 1027BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(12, 4), FileType); 1028BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(16, 4), NumberOfCommands); 1029BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(20, 4), SizeOfCommands); 1030BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(24, 4), Flags); 1031BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(28, 4), Reserved); 1055BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), LC_SEGMENT_64); 1056BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), (uint)(HeaderSize + NumberOfSections * MachSection.HeaderSize)); 1057bool encoded = Encoding.UTF8.TryGetBytes(Name, buffer.Slice(8, 16), out _); 1059BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(24, 8), Address); 1060BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(32, 8), Size); 1061BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(40, 8), FileOffset); 1062BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(48, 8), FileSize); 1063BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(56, 4), MaximumProtection); 1064BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(60, 4), InitialProtection); 1065BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(64, 4), NumberOfSections); 1066BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(68, 4), Flags); 1141bool encoded = Encoding.UTF8.TryGetBytes(SectionName, buffer.Slice(0, 16), out _); 1143encoded = Encoding.UTF8.TryGetBytes(SegmentName, buffer.Slice(16, 16), out _); 1145BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(32, 8), VirtualAddress); 1146BinaryPrimitives.WriteUInt64LittleEndian(buffer.Slice(40, 8), Size); 1147BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(48, 4), FileOffset); 1148BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(52, 4), Log2Alignment); 1149BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(56, 4), RelocationOffset); 1150BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(60, 4), NumberOfRelocationEntries); 1151BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(64, 4), Flags); 1193BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), nameIndex); 1196BinaryPrimitives.WriteUInt16LittleEndian(buffer.Slice(6, 2), Descriptor); 1216BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), LC_SYMTAB); 1217BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), (uint)HeaderSize); 1218BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(8, 4), SymbolTableOffset); 1219BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(12, 4), NumberOfSymbols); 1220BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(16, 4), StringTableOffset); 1221BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(20, 4), StringTableSize); 1254BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), LC_DYSYMTAB); 1255BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), (uint)HeaderSize); 1256BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(8, 4), LocalSymbolsIndex); 1257BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(12, 4), LocalSymbolsCount); 1258BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(16, 4), ExternalSymbolsIndex); 1259BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(20, 4), ExternalSymbolsCount); 1260BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(24, 4), UndefinedSymbolsIndex); 1261BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(28, 4), UndefinedSymbolsCount); 1262BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(32, 4), TableOfContentsOffset); 1263BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(36, 4), TableOfContentsCount); 1264BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(40, 4), ModuleTableOffset); 1265BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(44, 4), ModuleTableCount); 1266BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(48, 4), ExternalReferenceTableOffset); 1267BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(52, 4), ExternalReferenceTableCount); 1268BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(56, 4), IndirectSymbolTableOffset); 1269BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(60, 4), IndirectSymbolTableCount); 1270BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(64, 4), ExternalRelocationTableOffset); 1271BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(68, 4), ExternalRelocationTableCount); 1272BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(72, 4), LocalRelocationTableOffset); 1273BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(76, 4), LocalRelocationTableCount); 1291BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(0, 4), LC_BUILD_VERSION); 1292BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(4, 4), (uint)HeaderSize); 1293BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(8, 4), Platform); 1294BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(12, 4), MinimumPlatformVersion); 1295BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(16, 4), SdkVersion); 1296BinaryPrimitives.WriteUInt32LittleEndian(buffer.Slice(20, 4), 0); // No tools
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (1)
713return buffer.Slice(0, bytesWritten);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (1)
58_appendBuffer.GetSpan(paddingLength).Slice(0, paddingLength).Fill(_padding[0]);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionWriter.cs (1)
84buffer.Slice(0, size).Clear();
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\StringTableBuilder.cs (2)
112MultiKeySort(input.Slice(0, l), pos); 119input = input.Slice(l, h - l);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmDataSection.cs (1)
73outputFileStream.Write(countBuffer.Slice(0, countSize));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmInstructions.cs (8)
114WasmExpr.OffsetRelocationsByOffset(buffer.Slice(0, relocsEncoded), bodySizePrefixLength + _locals.Length); 219int adjustSize = expr.Encode(buffer.Slice(pos, encodeSizeExpected)); 258WasmExpr.OffsetRelocationsByOffset(buffer.Slice(totalRelocsEncoded, relocsEncoded), offset); 354DwarfHelper.WritePaddedULEB128(buffer.Slice(0, relocSize), 0); 359DwarfHelper.WritePaddedSLEB128(buffer.Slice(0, relocSize), 0); 415WasmExpr.OffsetRelocationsByOffset(buffer.Slice(0, relocsEncoded), base.EncodeSize() + (int)DwarfHelper.SizeOfULEB128(_align)); 472DwarfHelper.WritePaddedULEB128(buffer.Slice(pos, relocSize), 0); 508WasmExpr.OffsetRelocationsByOffset(buffer.Slice(0, relocsEncoded), base.EncodeSize());
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WebcilEncoder.cs (14)
47BinaryPrimitives.WriteUInt32LittleEndian(headerBuffer.Slice(0, 4), header.Id); 48BinaryPrimitives.WriteUInt16LittleEndian(headerBuffer.Slice(4, 2), header.VersionMajor); 49BinaryPrimitives.WriteUInt16LittleEndian(headerBuffer.Slice(6, 2), header.VersionMinor); 50BinaryPrimitives.WriteUInt16LittleEndian(headerBuffer.Slice(8, 2), header.CoffSections); 51BinaryPrimitives.WriteUInt16LittleEndian(headerBuffer.Slice(10, 2), header.Reserved0); 52BinaryPrimitives.WriteUInt32LittleEndian(headerBuffer.Slice(12, 4), header.PeCliHeaderRva); 53BinaryPrimitives.WriteUInt32LittleEndian(headerBuffer.Slice(16, 4), header.PeCliHeaderSize); 54BinaryPrimitives.WriteUInt32LittleEndian(headerBuffer.Slice(20, 4), header.PeDebugRva); 55BinaryPrimitives.WriteUInt32LittleEndian(headerBuffer.Slice(24, 4), header.PeDebugSize); 61BinaryPrimitives.WriteUInt32LittleEndian(headerBuffer.Slice(28, 4), 0); 82BinaryPrimitives.WriteUInt32LittleEndian(header.Slice(0, 4), sectionHeader.VirtualSize); 83BinaryPrimitives.WriteUInt32LittleEndian(header.Slice(4, 4), sectionHeader.VirtualAddress); 84BinaryPrimitives.WriteUInt32LittleEndian(header.Slice(8, 4), sectionHeader.SizeOfRawData); 85BinaryPrimitives.WriteUInt32LittleEndian(header.Slice(12, 4), sectionHeader.PointerToRawData);
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8StringBuilder.cs (1)
99buffer.Slice(0, bytesWritten).CopyTo(_buffer.AsSpan(_length));
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoTypes.cs (4)
1661return LoweredElements.Slice(0, (int)numLoweredElements).SequenceEqual(other.LoweredElements.Slice(0, (int)other.numLoweredElements)) 1662&& Offsets.Slice(0, (int)numLoweredElements).SequenceEqual(other.Offsets.Slice(0, (int)other.numLoweredElements));
ILCompiler.TypeSystem (12)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeSystemHelpers.cs (1)
491s4.Slice(0, s4length).CopyTo(buffer.Slice(s1.Length + s2.Length + s3.Length));
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILStackHelper.cs (1)
35stackalloc int[StackAllocThreshold].Slice(0, ilReader.Size) : new int[ilReader.Size];
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
illink (10)
ILLink.RoslynAnalyzer (10)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.AspNetCore.Antiforgery (7)
Internal\DefaultAntiforgeryTokenSerializer.cs (4)
227securityTokenBytes.CopyTo(tokenBytes.Slice(offset, securityTokenBytes.Length)); 236claimUidBytes!.CopyTo(tokenBytes.Slice(offset, claimUidBytes!.Length)); 242offset += tokenBytes[offset..].Write7BitEncodedString(token.Username!); 244offset += tokenBytes[offset..].Write7BitEncodedString(token.AdditionalData);
Internal\DefaultClaimUidExtractor.cs (1)
142SHA256.HashData(span.Slice(0, offset), destination);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (1)
57return _buffer.Slice(0, _index);
src\aspnetcore\src\Shared\Encoding\Int7BitEncodingUtils.cs (1)
110Encoding.UTF8.GetBytes(value.AsSpan(), target[lengthPrefixSize..]);
Microsoft.AspNetCore.Components (5)
NavigationManagerExtensions.cs (1)
823fragmentValue.AsSpan().CopyTo(chars[position..]);
PersistentState\PersistentStateValueProviderKeyResolver.cs (2)
75currentBuffer = keyBuffer[preKey.Length..]; 95currentBuffer = keyBuffer[preKey.Length..];
src\aspnetcore\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 (2)
FormMapping\FormDataReader.cs (1)
230separator.CopyTo(_prefixBuffer.Span[_currentPrefixBuffer.Length..]);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (1)
57return _buffer.Slice(0, _index);
Microsoft.AspNetCore.Components.Forms (4)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (4)
45span.CopyTo(_currentBuffer[startIndex..]); 64_currentBuffer[_nextEndIndex..].CopyTo(newBuffer.AsSpan(newEndIndex)); 86span.CopyTo(_currentBuffer[startIndex..]); 112? new(_currentBuffer[_nextEndIndex..])
Microsoft.AspNetCore.Components.QuickGrid (1)
Columns\GridSort.cs (1)
185body.Member.Name.CopyTo(chars[nextPos..]);
Microsoft.AspNetCore.Components.Server (2)
BlazorPack\SequenceOfT.cs (1)
443this.AvailableMemory.Span.Slice(startIndex, length).Clear();
src\aspnetcore\src\SignalR\common\Shared\BinaryMessageFormatter.cs (1)
17output.Write(lenBuffer.Slice(0, lenNumBytes));
Microsoft.AspNetCore.Components.Web (4)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (4)
45span.CopyTo(_currentBuffer[startIndex..]); 64_currentBuffer[_nextEndIndex..].CopyTo(newBuffer.AsSpan(newEndIndex)); 86span.CopyTo(_currentBuffer[startIndex..]); 112? new(_currentBuffer[_nextEndIndex..])
Microsoft.AspNetCore.DataProtection (33)
KeyManagement\KeyRingBasedSpanDataProtector.cs (2)
51BinaryPrimitives.WriteUInt32BigEndian(headerBuffer.Slice(0, sizeof(uint)), MAGIC_HEADER_V0); 52var writeKeyIdResult = defaultKeyId.TryWriteBytes(headerBuffer.Slice(sizeof(uint), sizeof(Guid)));
Managed\AesGcmAuthenticatedEncryptor.cs (10)
107var plaintext = buffer.Slice(0, plaintextBytes); 112? stackalloc byte[256].Slice(0, _keyDerivationKey.Length) 116? stackalloc byte[256].Slice(0, _derivedkeySizeInBytes) 244keyModifier.CopyTo(buffer.Slice(0, KEY_MODIFIER_SIZE_IN_BYTES)); 245nonceBytes.CopyTo(buffer.Slice(KEY_MODIFIER_SIZE_IN_BYTES, NONCE_SIZE_IN_BYTES)); 252? stackalloc byte[256].Slice(0, _keyDerivationKey.Length) 256? stackalloc byte[256].Slice(0, _derivedkeySizeInBytes) 275var nonce = buffer.Slice(KEY_MODIFIER_SIZE_IN_BYTES, NONCE_SIZE_IN_BYTES); 276var encrypted = buffer.Slice(KEY_MODIFIER_SIZE_IN_BYTES + NONCE_SIZE_IN_BYTES, plaintext.Length); 277var tag = buffer.Slice(KEY_MODIFIER_SIZE_IN_BYTES + NONCE_SIZE_IN_BYTES + plaintext.Length, TAG_SIZE_IN_BYTES);
Managed\ManagedAuthenticatedEncryptor.cs (13)
114? stackalloc byte[256].Slice(0, _keyDerivationKey.Length) 119? stackalloc byte[128].Slice(0, _validationAlgorithmSubkeyLengthInBytes) 123? stackalloc byte[128].Slice(0, _symmetricAlgorithmSubkeyLengthInBytes) 198? stackalloc byte[128].Slice(0, keyModifierLength) 204keyModifier.CopyTo(buffer.Slice(0, keyModifierLength)); 207var iv = buffer.Slice(keyModifierLength, ivLength); 212? stackalloc byte[256].Slice(0, _keyDerivationKey.Length) 217? stackalloc byte[128].Slice(0, _validationAlgorithmSubkeyLengthInBytes) 221? stackalloc byte[128].Slice(0, _symmetricAlgorithmSubkeyLengthInBytes) 245var ciphertextDestination = buffer.Slice(keyModifierLength + ivLength, cipherTextLength); 249var ivAndCipherTextSpan = buffer.Slice(keyModifierLength, ivLength + cipherTextLength); 250var macDestinationSpan = buffer.Slice(keyModifierLength + ivLength + cipherTextLength, macLength); 411? stackalloc byte[128].Slice(0, hashSize)
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (6)
91? stackalloc byte[128].Slice(0, prfOutputSizeInBytes) 101? stackalloc byte[128].Slice(0, prfInputLength) 156var destination = operationSubkey.Slice(operationSubKeyIndex, bytesToWrite); 157prfOutput.Slice(0, bytesToWrite).CopyTo(destination); 163var destination = validationSubkey.Slice(validationSubKeyIndex, leftOverBytes); 164prfOutput.Slice(bytesToWrite, leftOverBytes).CopyTo(destination);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (1)
57return _buffer.Slice(0, _index);
src\aspnetcore\src\Shared\Encoding\Int7BitEncodingUtils.cs (1)
110Encoding.UTF8.GetBytes(value.AsSpan(), target[lengthPrefixSize..]);
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (1)
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (1)
57return _buffer.Slice(0, _index);
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (1)
RedactionBenchmark.cs (1)
235return destination.Slice(0, source.Length);
Microsoft.AspNetCore.Http.Abstractions (6)
PathString.cs (3)
192var length = UrlDecoder.DecodeInPlace(pathBuffer.Slice(position, uriComponent.Length - position)); 193pathBuffer = pathBuffer.Slice(0, position + length); 209pathBuffer = pathBuffer.Slice(0, length + 1);
src\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (2)
29return DecodeInPlace(destination.Slice(0, source.Length), isFormEncoding); 363return DecodeInPlace(destination.Slice(0, source.Length));
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
54public ReadOnlySpan<T> AsSpan() => _span.Slice(0, _pos);
Microsoft.AspNetCore.Http.Connections.Common (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
150return _memory.Span.Slice(_memoryUsed, _memory.Length - _memoryUsed);
Microsoft.AspNetCore.Http.Extensions (16)
src\aspnetcore\src\Components\Endpoints\src\FormMapping\FormDataReader.cs (1)
230separator.CopyTo(_prefixBuffer.Span[_currentPrefixBuffer.Length..]);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
54public ReadOnlySpan<T> AsSpan() => _span.Slice(0, _pos);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (13)
93string s = _chars.Slice(0, _pos).ToString(); 112return _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 116public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 117public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 121if (_chars.Slice(0, _pos).TryCopyTo(destination)) 143_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 144_chars.Slice(index, count).Fill(value); 163_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 268return _chars.Slice(origPos, length); 295_chars.Slice(0, _pos).CopyTo(poolArray);
UriHelper.cs (1)
219text.CopyTo(buffer.Slice(index, text.Length));
Microsoft.AspNetCore.HttpLogging (15)
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (1)
57return _buffer.Slice(0, _index);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
54public ReadOnlySpan<T> AsSpan() => _span.Slice(0, _pos);
src\aspnetcore\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\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
150return _memory.Span.Slice(_memoryUsed, _memory.Length - _memoryUsed);
Microsoft.AspNetCore.Razor.Utilities.Shared (6)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\MemoryBuilder`1.cs (1)
130source.CopyTo(_memory.Span[_length..]);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\MemoryBuilderExtensions.cs (1)
59destination = destination[chunk.Length..];
Utilities\Hashing\NonCryptographicHashAlgorithm.cs (4)
213GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 237GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 275GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 299GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
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.Server.HttpSys (17)
_generated\30\Windows.Win32.HTTP_KNOWN_HEADER.InlineArrays.g.cs (2)
54 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 94 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\4\Windows.Win32.byte.InlineArrays.g.cs (1)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\6\Windows.Win32.char.InlineArrays.g.cs (3)
79 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 118 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 158 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\90\Windows.Win32.ushort.InlineArrays.g.cs (1)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (1)
65return raw.Slice(pathStartIndex, scan - pathStartIndex);
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (2)
42return UTF8.GetString(unescapedPath.Slice(0, length)); 92return rawPath.Slice(0, writer);
src\aspnetcore\src\Shared\PathNormalizer\PathNormalizer.cs (7)
26var currentSrc = src[readPointer..]; 35currentSrc.CopyTo(src[writtenLength..]); 42currentSrc[..nextDotSegmentIndex].CopyTo(src[writtenLength..]); 74src.Slice(readPointer, 3).CopyTo(src[writtenLength..]); 110src[readPointer..].CopyTo(src[writtenLength..]);
Microsoft.AspNetCore.Server.IIS (16)
_generated\15\Windows.Win32.HTTP_KNOWN_HEADER.InlineArrays.g.cs (1)
54 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\3\Windows.Win32.byte.InlineArrays.g.cs (1)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\49\Windows.Win32.ushort.InlineArrays.g.cs (1)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\5\Windows.Win32.char.InlineArrays.g.cs (3)
79 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 118 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 158 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (1)
65return raw.Slice(pathStartIndex, scan - pathStartIndex);
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (2)
42return UTF8.GetString(unescapedPath.Slice(0, length)); 92return rawPath.Slice(0, writer);
src\aspnetcore\src\Shared\PathNormalizer\PathNormalizer.cs (7)
26var currentSrc = src[readPointer..]; 35currentSrc.CopyTo(src[writtenLength..]); 42currentSrc[..nextDotSegmentIndex].CopyTo(src[writtenLength..]); 74src.Slice(readPointer, 3).CopyTo(src[writtenLength..]); 110src[readPointer..].CopyTo(src[writtenLength..]);
Microsoft.AspNetCore.Server.Kestrel.Core (35)
Internal\Http\Http1Connection.cs (4)
425var target = startLine[targetStart..]; 440else if (startLine[targetStart..].GetKnownHttpScheme(out _)) 561var query = target[targetPath.Length..]; 653Span<byte> query = target[targetPath.Length..];
Internal\Http\Http1OutputProducer.cs (1)
803public ReadOnlySpan<byte> Span => Buffer.Span.Slice(0, Length);
Internal\Http\HttpParser.cs (2)
227headerSpan = headerSpan.Slice(0, length); 244if (terminatorSize == -1 || !TryTakeSingleHeader(handler, headerSpan.Slice(0, headerSpan.Length - terminatorSize)))
Internal\Http\HttpRequestHeaders.cs (1)
135!long.TryParse(decodedChars.Slice(0, numChars), NumberStyles.None, CultureInfo.InvariantCulture, out parsed) ||
Internal\Http\PathDecoder.cs (3)
31pathLength = PathNormalizer.RemoveDotSegments(path.Slice(0, pathLength)); 33return Encoding.UTF8.GetString(path.Slice(0, pathLength)); 45return path.Slice(0, pathLength).GetAsciiString();
Internal\Http2\Http2FrameWriter.cs (1)
916var buffer = _outputWriter.GetSpan(settingsSize).Slice(0, settingsSize); // GetSpan isn't precise
Internal\Http2\Http2Stream.cs (1)
443? stackalloc byte[MaxPathBufferStackAllocSize].Slice(0, pathSegment.Length)
Internal\Http3\Http3Stream.cs (1)
1270? 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\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (1)
57return _buffer.Slice(0, _index);
src\aspnetcore\src\Shared\PathNormalizer\PathNormalizer.cs (7)
26var currentSrc = src[readPointer..]; 35currentSrc.CopyTo(src[writtenLength..]); 42currentSrc[..nextDotSegmentIndex].CopyTo(src[writtenLength..]); 74src.Slice(readPointer, 3).CopyTo(src[writtenLength..]); 110src[readPointer..].CopyTo(src[writtenLength..]);
src\aspnetcore\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\aspnetcore\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\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (2)
29return DecodeInPlace(destination.Slice(0, source.Length), isFormEncoding); 363return DecodeInPlace(destination.Slice(0, source.Length));
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
1034? stackalloc bool[MaxStackSize].Slice(0, args.Length)
Microsoft.AspNetCore.SignalR.Common (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
150return _memory.Span.Slice(_memoryUsed, _memory.Length - _memoryUsed);
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
150return _memory.Span.Slice(_memoryUsed, _memory.Length - _memoryUsed);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
src\aspnetcore\src\SignalR\common\Shared\BinaryMessageFormatter.cs (1)
17output.Write(lenBuffer.Slice(0, lenNumBytes));
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
150return _memory.Span.Slice(_memoryUsed, _memory.Length - _memoryUsed);
Microsoft.AspNetCore.WebSockets (14)
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
54public ReadOnlySpan<T> AsSpan() => _span.Slice(0, _pos);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (13)
93string s = _chars.Slice(0, _pos).ToString(); 112return _chars.Slice(0, _pos); 115public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 116public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 117public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 121if (_chars.Slice(0, _pos).TryCopyTo(destination)) 143_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 144_chars.Slice(index, count).Fill(value); 163_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 222Span<char> dst = _chars.Slice(_pos, count); 238Span<char> dst = _chars.Slice(_pos, length); 268return _chars.Slice(origPos, length); 295_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.AspNetCore.WebUtilities (8)
FileBufferingReadStream.cs (1)
309_buffer.Write(buffer.Slice(0, read));
FormPipeReader.cs (2)
354Span<byte> buffer = stackalloc byte[StackAllocThreshold].Slice(0, (int)ros.Length); 403span = span.Slice(0, bytes);
HttpRequestStreamReader.cs (3)
200buffer = buffer.Slice(charsRemaining, count); 404span = span.Slice(0, index); 434span = span.Slice(0, index);
src\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (2)
29return DecodeInPlace(destination.Slice(0, source.Length), isFormEncoding); 363return DecodeInPlace(destination.Slice(0, source.Length));
Microsoft.Build (17)
Logging\BinaryLogger\Postprocessing\SubStream.cs (1)
87buffer = buffer.Slice(0, Math.Min((int)Math.Max(Length - _position, 0), buffer.Length));
Logging\BinaryLogger\Postprocessing\TransparentReadStream.cs (1)
135buffer = buffer.Slice(0, (int)(_maxAllowedPosition - _position));
Logging\OptimizedStringIndenter.cs (3)
78output.Slice(0, state.indent).Fill(' '); 117segments = segments.Slice(0, 1); 135segments = segments.Slice(0, segmentCount);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
Microsoft.Build.Framework (26)
Collections\RefArrayBuilder.cs (8)
205span.Slice(index, toCopy).CopyTo(span.Slice(index + 1, toCopy)); 247span.Slice(index, toCopy).CopyTo(span.Slice(index + source.Length, toCopy)); 273source.CopyTo(span.Slice(index, source.Length)); 322span[startIndex.._count].CopyTo(destination.Slice(startIndex + size)); 346span.Slice(index + 1, toCopy).CopyTo(span.Slice(index, toCopy));
Coordinator\CoordinatorSettings.cs (1)
172span = span[prefix.Length..];
EscapingUtilities.cs (1)
248destination = destination[charsToCopy..];
FileUtilities.cs (2)
801return str.Slice(0, sliceLength); 814return hasQuotes ? path.Slice(1, endId - 1) : path;
Utilities\BufferScope.cs (1)
128=> _span.Slice(start, length);
Utilities\ProcessExtensions.cs (2)
545if (Sysctl(mib, buffer.AsSpan().Slice(0, (int)size), ref size) != 0) 556ReadOnlySpan<byte> data = buffer.AsSpan().Slice(0, (int)size);
Utilities\ValueStringBuilder.cs (11)
176return _chars[start.._length]; 189return _chars.Slice(start, length); 208return _chars.Slice(originalLength, length); 241_chars.Slice(index, remaining).CopyTo(_chars[(index + count)..]); 242_chars.Slice(index, count).Fill(value); 267_chars.Slice(index, remaining).CopyTo(_chars[(index + count)..]); 268s.AsSpan().CopyTo(_chars[index..]); 322s.AsSpan().CopyTo(_chars[pos..]); 336Span<char> dst = _chars.Slice(_length, count); 356Span<char> dst = _chars.Slice(_length, length); 376value.CopyTo(_chars[_length..]);
Microsoft.CodeAnalysis (20)
CommandLine\CommandLineParser.cs (2)
610lineBuffer.Slice(0, lineBufferLength), 628lineBuffer.Slice(0, lineBufferLength),
Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
Syntax\SyntaxTriviaListBuilder.cs (1)
101items.Slice(offset, length).CopyTo(_nodes.AsSpan().Slice(_count, length));
Text\SourceText.cs (1)
761buffer = buffer[copyLength..];
Microsoft.CodeAnalysis.Analyzers (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
141tempBuffer = tempBuffer.Slice(0, charsWritten);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (2)
103var contentHash = bytes[HashIndex..HashSize].ToImmutableArray(); 104var position = BinaryPrimitives.ReadInt32LittleEndian(bytes[PositionIndex..]);
Microsoft.CodeAnalysis.AnalyzerUtilities (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
141tempBuffer = tempBuffer.Slice(0, charsWritten);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (2)
103var contentHash = bytes[HashIndex..HashSize].ToImmutableArray(); 104var position = BinaryPrimitives.ReadInt32LittleEndian(bytes[PositionIndex..]);
Microsoft.CodeAnalysis.CodeStyle (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
141tempBuffer = tempBuffer.Slice(0, charsWritten);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (2)
103var contentHash = bytes[HashIndex..HashSize].ToImmutableArray(); 104var position = BinaryPrimitives.ReadInt32LittleEndian(bytes[PositionIndex..]);
Microsoft.CodeAnalysis.Extensions.Package (12)
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
Microsoft.CodeAnalysis.Razor.Compiler (8)
Language\CodeGeneration\CodeWriter.cs (2)
459destination = destination[source.Length..]; 530destination = destination[source.Length..];
Language\CodeGeneration\CodeWriter.IndentCache.cs (1)
36destination[tabCount..].Fill(' ');
Language\DefaultRazorProjectFileSystem.cs (1)
142span = span[rootSpan.Length..];
Language\RazorProjectFileSystem.cs (2)
131span = span[memory.Length..]; 134Debug.Assert(span[fileName.Length..].IsEmpty);
Language\Syntax\GreenNode.cs (1)
220span = span[content.Length..];
Language\TagHelperCollection.SegmentCollectionBase.cs (1)
104destination = destination[segment.Length..];
Microsoft.CodeAnalysis.ResxSourceGenerator (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
141tempBuffer = tempBuffer.Slice(0, charsWritten);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (2)
103var contentHash = bytes[HashIndex..HashSize].ToImmutableArray(); 104var position = BinaryPrimitives.ReadInt32LittleEndian(bytes[PositionIndex..]);
Microsoft.CodeAnalysis.Workspaces (20)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
141tempBuffer = tempBuffer.Slice(0, charsWritten);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (2)
103var contentHash = bytes[HashIndex..HashSize].ToImmutableArray(); 104var position = BinaryPrimitives.ReadInt32LittleEndian(bytes[PositionIndex..]);
Workspace\Solution\Checksum_Factory.cs (1)
147var hashSpan = checksumsSpan.Slice(0, count);
Microsoft.Data.Analysis (5)
DataFrameBuffer.cs (1)
32get => (MemoryMarshal.Cast<byte, T>(Buffer.Span)).Slice(0, Length);
PrimitiveColumnContainer.cs (1)
170mutableLastBuffer.RawSpan.Slice(mutableLastBuffer.Length - allocatable, allocatable).Fill(value.Value);
Utils\BitUtility.cs (3)
119var slice = data.Slice(startByteIndex, 1); 126var slice = data.Slice(fullByteStartIndex, fullByteEndIndex - fullByteStartIndex + 1); 134var slice = data.Slice(endByteIndex, 1);
Microsoft.Diagnostics.DataContractReader.Contracts (7)
Contracts\StackWalk\Context\ContextHolder.cs (1)
39buffer.Slice(0, sizeof(T)).CopyTo(byteSpan);
LinearReadCache.cs (1)
26buffer = buffer.Slice(0, _target.PointerSize);
src\runtime\src\coreclr\tools\aot\ILCompiler.Reflection.ReadyToRun\NativeReader.cs (2)
400ReadSpanAt(ref readStart, buffer.Slice(0, bytesToRead)); 401uint result = checked((uint)DwarfHelper.ReadULEB128(buffer.Slice(0, bytesToRead), out int bytesRead));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (2)
91bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill(0x80); 103bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill((byte)(padValue | 0x80));
TargetStream.cs (1)
31return Read(span.Slice(start: offset, length: count));
Microsoft.DotNet.Build.Tasks.Installers (3)
src\RpmHeader.cs (3)
210contents.SetValue(BinaryPrimitives.ReadInt16BigEndian(store.AsSpan().Slice(offset.AlignUp(2), 2)), i); 215contents.SetValue(BinaryPrimitives.ReadInt32BigEndian(store.AsSpan().Slice(offset.AlignUp(4), 4)), i); 220contents.SetValue(BinaryPrimitives.ReadInt64BigEndian(store.AsSpan().Slice(offset.AlignUp(8), 8)), i);
Microsoft.DotNet.Cli.Utils (1)
BufferScope.cs (1)
132=> _span.Slice(start, length);
Microsoft.DotNet.TemplateLocator (3)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (3)
55span = buffer.AsSpan().Slice(0, readCount); 59span = span.Slice(utf8Bom.Length, span.Length - utf8Bom.Length); 103span = newBuffer.AsSpan().Slice(0, remaining + readCount);
Microsoft.Extensions.Caching.Hybrid (2)
Internal\DefaultHybridCache.StampedeStateT.cs (2)
598byteBuffer = byteBuffer.Slice(0, HybridCachePayload.Encoding.GetBytes(value.AsSpan(), byteBuffer)); 599charBuffer = charBuffer.Slice(0, HybridCachePayload.Encoding.GetChars(byteBuffer, charBuffer));
Microsoft.Extensions.Compliance.Abstractions (4)
Redaction\RedactionStringBuilderExtensions.cs (1)
61return stringBuilder.Append(destination.Slice(0, written));
Redaction\Redactor.cs (3)
122var formatted = buffer.Slice(0, written); 182var formatted = buffer.Slice(0, written); 233var formatted = buffer.Slice(0, written);
Microsoft.Extensions.Compliance.Testing (1)
FakeRedactor.cs (1)
84EventCollector.Append(new RedactedData(sourceString, destination.Slice(0, str.Length).ToString(), order));
Microsoft.Extensions.Configuration.Binder.SourceGeneration (5)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
Microsoft.Extensions.Configuration.EnvironmentVariables (10)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.Extensions.DataIngestion (10)
Chunkers\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.Extensions.DependencyInjection.Abstractions (3)
ActivatorUtilities.cs (3)
78Span<object?> ctorArgs = values.Slice(0, maxArgs); 79Span<object?> bestCtorArgs = values.Slice(maxArgs, maxArgs); 884return _constructor.Invoker.Invoke(_parameterValues.Slice(0, _constructor.Parameters.Length));
Microsoft.Extensions.Logging.Abstractions (10)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.Extensions.Logging.Console (11)
SimpleConsoleFormatter.cs (1)
107textWriter.Write(span.Slice(0, charsWritten));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.Extensions.Logging.Generators (5)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
Microsoft.Extensions.ServiceDiscovery.Dns (2)
Resolver\DnsPrimitives.cs (2)
107Span<byte> nameBuffer = destination.Slice(0, 1 + length); 113label = index == -1 ? nameBuffer.Slice(1) : nameBuffer.Slice(1, index);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (6)
Resolver\DnsDataWriterTests.cs (3)
34Assert.Equal(expected, buffer.AsSpan().Slice(0, writer.Position).ToArray()); 82Assert.Equal(expected, buffer.AsSpan().Slice(0, writer.Position).ToArray()); 138Assert.Equal(expected, buffer.AsSpan().Slice(0, writer.Position).ToArray());
Resolver\DnsPrimitivesTests.cs (3)
28Assert.Equal(expected, buffer.AsSpan().Slice(0, written).ToArray()); 78Assert.Equal(buffer1.AsSpan().Slice(0, written1).ToArray(), buffer2.AsSpan().Slice(0, written2).ToArray());
Microsoft.Extensions.Telemetry (2)
Logging\JustInTimeRedactor.cs (2)
149var finalToBeRedacted = workBuffer.Slice(0, charsInWorkBuffer); 159result = t.AsSpan().Slice(0, redactedLen).ToString();
Microsoft.Extensions.Telemetry.Tests (2)
Logging\JustInTimeRedactorTests.cs (2)
47Assert.Equal($"{ShortRedactorPrefix}<{redactorInput}>", d.Slice(0, charsWritten).ToString()); 71Assert.Equal($"{longRedactorPrefix}<{redactorInput}>", d.Slice(0, charsWritten).ToString());
Microsoft.ML.Core (7)
Utilities\Stream.cs (1)
717rentedArray.AsSpan(0, numElementsToReadThisChunk * sizeof(T)).CopyTo(MemoryMarshal.AsBytes(destination.Slice(0, numElementsToReadThisChunk)));
Utilities\VBufferUtils.cs (6)
342editor.Indices.Slice(idx, sliceLength).CopyTo(editor.Indices.Slice(idx + 1)); 343editor.Values.Slice(idx, sliceLength).CopyTo(editor.Values.Slice(idx + 1)); 380editor.Values.Slice(min, indices[ii] - min).Clear(); 383editor.Values.Slice(min, dst.Length - min).Clear(); 433editor.Values.Slice(lim, sliceLength).CopyTo(editor.Values.Slice(denseCount)); 434editor.Indices.Slice(lim, sliceLength).CopyTo(editor.Indices.Slice(denseCount));
Microsoft.ML.CpuMath (5)
CpuMathUtils.cs (5)
75TensorPrimitives.MultiplyAdd(source.Slice(0, count), scale, destination.Slice(0, count), destination); 97TensorPrimitives.MultiplyAdd(source.Slice(0, count), scale, destination.Slice(0, count), result.Slice(0, count)); 115TensorPrimitives.Add(source.Slice(0, count), destination.Slice(0, count), destination.Slice(0, count)); 136TensorPrimitives.Multiply(left.Slice(0, count), right.Slice(0, count), destination.Slice(0, count));
Microsoft.ML.Data (2)
Deprecated\Vector\VBufferMathUtils.cs (2)
309indices.Slice(dLim, dstValues.Length - dLim) 311values.Slice(dLim, dstValues.Length - dLim)
Microsoft.ML.DataView (1)
VBuffer.cs (1)
300destination.Slice(destinationIndex, Length).Clear();
Microsoft.ML.FastTree (1)
FastTree.cs (1)
2524editor.Values.Slice(_dense.Count, length - _dense.Count).Clear();
Microsoft.ML.ImageAnalytics (2)
ImageLoader.cs (2)
343srcSpan = readBufferSpan.Slice(0, bytesRead); 344var dstSpan = bufferSpan.Slice(totalBytesRead, bytesRead);
Microsoft.ML.StandardTrainers (1)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
1245float softmax = MathUtils.SoftMax(dst.Slice(0, NumberOfClasses));
Microsoft.ML.TestFrameworkCommon (1)
TestLogger.cs (1)
49span = span.Slice(0, count - 2);
Microsoft.ML.Tokenizers (77)
Model\BPETokenizer.cs (8)
1056current = utf8bytes.Slice(incompleteUtf8BytesInBufferIndex, incompleteUtf8BytesInBuffer + span.Length); 1070vocabBuffer.Slice(0, completeCharsWritten).CopyTo(buffer); 1221s = buffer.Slice(0, ContinuingSubwordPrefix.Length + s.Length); 1241s = buffer.Slice(0, s.Length + EndOfWordSuffix.Length); 1339textSpan = token.Slice(0, encodedLength); 1340mapping = mapping.Slice(0, encodedLength); 1452textSpan = token.Slice(0, encodedLength); 1532textSpan = token.Slice(0, encodedLength);
Model\CodeGenTokenizer.cs (13)
352span = mutatedInputSpan.Slice(0, span.Length + 1); 464List<EncodedToken> result = EncodeToTokens(token.Slice(0, encodedLength), mapping.Slice(0, encodedLength), textSpan, agenda); 609span = mutatedInputSpan.Slice(0, span.Length + 1); 828span = mutatedInputSpan.Slice(0, span.Length + 1); 965span = mutatedInputSpan.Slice(0, span.Length + 1); 1147List<EncodedToken> result = EncodeToTokens(token.Slice(0, encodedLength), mapping.Slice(0, encodedLength), textSpan, agenda); 1211List<EncodedToken> result = EncodeToTokens(token.Slice(0, encodedLength), mapping.Slice(0, encodedLength), textSpan, agenda); 1482current = utf8bytes.Slice(incompleteUtf8BytesInBufferIndex, incompleteUtf8BytesInBuffer + span.Length); 1496vocabBuffer.Slice(0, completeCharsWritten).CopyTo(buffer); 1663if (_vocab.TryGetValue(text.Slice(symbols[index].pieceSpan.Index, symbols[index].pieceSpan.Length), out (int Id, string Token) value))
Model\EnglishRobertaTokenizer.cs (3)
393List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping); 699List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping); 744List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping);
Model\SentencePieceBaseModel.cs (1)
602destination.Slice(suffixIndex + 1, charsWritten - suffixIndex - 1).CopyTo(destination.Slice(suffixIndex));
Model\SentencePieceUnigramModel.cs (13)
531normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 559normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 582int normalizationCount = Normalizer!.Normalize(byteSpan.Slice(0, byteCount), ref normalizationSpan, ref normalizedArrayPool); 583normalizationSpan = normalizationSpan.Slice(0, normalizationCount); 597normalizationSpan = byteSpan.Slice(0, byteCount); 637string stringToken = node.Id == UnknownId ? Helpers.GetString(normalizationSpan.Slice(node.StartsAt, endsAt - node.StartsAt)) : _vocabReverse[node.Id].Piece; 986normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1008normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1173ReadOnlySpan<byte> utf8UnknownBytes = normalizationSpan.Slice(unknownTokensTracking![j].Utf8Index, unknownTokensTracking![j].Utf8Length); 1366normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1388normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1480charsConsumed += Helpers.GetUtf16LengthFromUtf8Bytes(normalizationSpan.Slice(ids[i].UtfStartOffset, ids[i].Utf8Length)); 1701consumedCharacters += Helpers.GetUtf16LengthFromUtf8Bytes(normalizationSpan.Slice(node.StartsAt, length));
Model\TiktokenTokenizer.cs (8)
331(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1)); 448(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1)); 613(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1)); 739(int Id, int TokenIndex, int TokenLength)[] encodedTokens = BytePairEncoder.BytePairEncode(arrayPoolArray.AsMemory(0, encodedLength), _encoder, indexMappingSpan.Slice(0, encodedLength + 1)); 829return Helpers.GetString(utf8Bytes.Slice(0, utf8ByteCount)); 922tempBuffer.Slice(0, incompleteCharsWritten).CopyTo(buffer); 945if (!Helpers.ConvertUtf8ToUtf16(utf8Bytes.Slice(utf8BytesIncompleteIndex, utf8BytesIncompleteCount + tokenBytes.Length), tempBuffer, out int bytesConsumed, out int charsConsumed)) 955tempBuffer.Slice(0, charsConsumed).CopyTo(buffer);
Model\WordPieceTokenizer.cs (2)
346subStr = buffer.Slice(0, ContinuingSubwordPrefix.Length + subStr.Length); 487subStr = buffer.Slice(0, ContinuingSubwordPrefix.Length + subStr.Length);
Normalizer\BertNormalizer.cs (1)
88AddSpan(ref buffer, ref index, casingBuffer.Slice(0, length));
Normalizer\SentencePieceNormalizer.cs (4)
189span = span.Slice(0, spanLength); 240string result = span.Slice(0, bufferIndex).ToString(); 296if (currentIndex >= tokenLength - 1 && span.Slice(currentIndex - tokenLength + 1, tokenLength).SequenceEqual(token.AsSpan())) 522while (normalized.Slice(0, normalizedIndex).EndsWith(space))
Utils\BytePairEncoder.cs (2)
37byteIndicesAndRanks = byteIndicesAndRanks.Slice(0, requiredLength); 88byteIndicesAndRanks = byteIndicesAndRanks.Slice(0, byteIndicesAndRanks.Length - 1);
Utils\Helpers.netcoreapp.cs (1)
92buffer.Slice(0, bytesWritten).CopyTo(destination.AsSpan(bytesIndex));
Utils\OrdinalUtf8StringComparer.cs (2)
76int result = buffer1.Slice(0, xLen).SequenceCompareTo(buffer2.Slice(0, yLen));
Utils\ValueStringBuilder.cs (19)
95Span<char> span = _chars.Slice(0, _pos); 104string s = _chars.Slice(0, _pos).ToString(); 123return _chars.Slice(0, _pos); 137public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 138public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 139public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 143if (_chars.Slice(0, _pos).TryCopyTo(destination)) 165ReadOnlySpan<char> buffer = _chars.Slice(index, _pos - index); 180_chars.Slice(newIndex, _pos - newIndex).CopyTo(_chars.Slice(index + newLength)); 189_chars.Slice(newIndex, _pos - newIndex).CopyTo(_chars.Slice(index + newLength)); 213_chars.Slice(start + length, remaining).CopyTo(_chars.Slice(start)); 226return _chars.Slice(_pos - valueLength, valueLength).SequenceEqual(value.AsSpan()); 237_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 238_chars.Slice(index, count).Fill(value); 257_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 325Span<char> dst = _chars.Slice(_pos, count); 341Span<char> dst = _chars.Slice(_pos, length); 371return _chars.Slice(origPos, length); 407_chars.Slice(0, _pos).CopyTo(poolArray);
Microsoft.ML.Tokenizers.Tests (23)
BpeTests.cs (1)
341status = bpe.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens, out idsConsumed, out charactersWritten);
CodeGenTests.cs (1)
314status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), hasPrefixSpace, considerSpecialTokens, out idsConsumed, out charactersWritten);
EnglishRobertaTests.cs (1)
319status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten);
LlamaTests.cs (11)
310status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten); 848Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten)); 850Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 862Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens: true, out idsConsumed, out charactersWritten)); 864Assert.True(textWithSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 887Assert.Equal(OperationStatus.DestinationTooSmall, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten)); 889Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 895Assert.Equal(decodedWithNoSpecialTokens, destinationBuffer.AsSpan().Slice(0, charactersWritten).ToString()); 901Assert.Equal(OperationStatus.DestinationTooSmall, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens: true, out idsConsumed, out charactersWritten)); 903var sp = destinationBuffer.AsSpan().Slice(0, charactersWritten); 906sp = sp.Slice(0, sp.Length - 1);
src\Microsoft.ML.Tokenizers\Utils\Helpers.netcoreapp.cs (1)
92buffer.Slice(0, bytesWritten).CopyTo(destination.AsSpan(bytesIndex));
src\Microsoft.ML.Tokenizers\Utils\OrdinalUtf8StringComparer.cs (2)
76int result = buffer1.Slice(0, xLen).SequenceCompareTo(buffer2.Slice(0, yLen));
TiktokenTests.cs (1)
181status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten);
UnigramTests.cs (3)
545Assert.Equal(decodedString, buffer.AsSpan().Slice(0, charsWritten).ToString()); 549status = tokenizer.Decode(ids, buffer.AsSpan().Slice(0, i), considerSpecialTokens: false, out idsConsumed, out charsWritten); 551Assert.Equal(decodedString.AsSpan().Slice(0, charsWritten).ToString(), buffer.AsSpan().Slice(0, charsWritten).ToString());
WordPieceTests.cs (2)
101Span<char> bufferSlice = buffer.Slice(0, i); 114Assert.Equal(j == 0 ? "" : text.Substring(0, tokens[j - 1].Offset.End.Value), bufferSlice.Slice(0, charsWritten).ToString());
Microsoft.ML.Transforms (4)
Dracula\CountTableTransformer.cs (2)
715_parent.Featurizer.GetFeatures(iinfo, i, rand, srcValues[i], editor.Values.Slice(i * outputLength, outputLength)); 725_parent.Featurizer.GetFeatures(iinfo, index, rand, srcValues[i], editor.Values.Slice(index * outputLength, outputLength));
Dracula\Featurizer.cs (2)
143var countsBuffer = features.Slice(0, _labelBinCount); 162GenerateLogOdds(iCol, countTable, countsBuffer, features.Slice(_labelBinCount, _logOddsCount), sum);
Microsoft.NET.Build.Containers (1)
Layer.cs (1)
335Span<byte> checksumField = header.Slice(ChecksumOffset, ChecksumLength);
Microsoft.NET.Build.Tasks (3)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (3)
55span = buffer.AsSpan().Slice(0, readCount); 59span = span.Slice(utf8Bom.Length, span.Length - utf8Bom.Length); 103span = newBuffer.AsSpan().Slice(0, remaining + readCount);
Microsoft.Net.Http.Headers (1)
ContentDispositionHeaderValue.cs (1)
562var result = Encoding.UTF8.GetString(buffer.Slice(0, MimePrefix.Length + base64ContentLength + MimeSuffix.Length));
Microsoft.NET.Sdk.WorkloadManifestReader (3)
WorkloadManifestReader.SystemTextJson.cs (3)
55span = buffer.AsSpan().Slice(0, readCount); 59span = span.Slice(utf8Bom.Length, span.Length - utf8Bom.Length); 103span = newBuffer.AsSpan().Slice(0, remaining + readCount);
Microsoft.Private.Windows.Core (31)
_generated\12\Windows.Win32.byte.InlineArrays.g.cs (1)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\165\Windows.Win32.ITypeLib.g.cs (2)
226 szNameBuf = szNameBuf.Slice(0, wstrszNameBuf.Length); 261 szNameBuf = szNameBuf.Slice(0, wstrszNameBuf.Length);
_generated\214\Windows.Win32.RECT.InlineArrays.g.cs (1)
49 target.Slice(initLength, SpanLength - initLength).Clear();
_generated\253\Windows.Win32.System_Com_ITypeLib_Extensions.g.cs (2)
92 szNameBuf = szNameBuf.Slice(0, wstrszNameBuf.Length); 110 szNameBuf = szNameBuf.Slice(0, wstrszNameBuf.Length);
_generated\37\Windows.Win32.char.InlineArrays.g.cs (2)
79 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 143 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\StreamExtensions.cs (1)
87int read = stream.Read(buffer[totalRead..]);
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\StringExtensions.cs (6)
51str1.CopyTo(resultSpan[str0.Length..]); 71resultSpan = resultSpan[str0.Length..]; 73resultSpan = resultSpan[str1.Length..]; 105resultSpan = resultSpan[str0.Length..]; 107resultSpan = resultSpan[str1.Length..]; 109resultSpan = resultSpan[str2.Length..];
System\BufferScope.cs (2)
105public readonly Span<T> this[Range range] => _span[range]; 107public readonly Span<T> Slice(int start, int length) => _span.Slice(start, length);
System\SpanWriter.cs (3)
17set => _unwritten = Span[value..]; 77public void Advance(int count) => _unwritten = _unwritten[count..]; 101span = span.Slice(start, length);
System\Text\ValueStringBuilder.cs (11)
134public readonly ReadOnlySpan<char> AsSpan(int start) => _chars[start.._pos]; 135public readonly ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 161_chars.Slice(index, remaining).CopyTo(_chars[(index + count)..]); 162_chars.Slice(index, count).Fill(value); 181_chars.Slice(index, remaining).CopyTo(_chars[(index + count)..]); 182s.CopyTo(_chars[index..]); 236s.CopyTo(_chars[pos..]); 245while (!((ISpanFormattable)value).TryFormat(_chars[_pos..], out charsWritten, format: default, provider: default)) 265Span<char> dst = _chars.Slice(_pos, count); 282Span<char> dst = _chars.Slice(_pos, length); 299value.CopyTo(_chars[_pos..]);
Microsoft.TestPlatform.AdapterUtilities (1)
TestIdProvider.cs (1)
107var hashSlice = GetHash().AsSpan().Slice(0, 16);
Microsoft.Win32.Registry (5)
Microsoft\Win32\RegistryKey.cs (4)
792names[cpt++] = new string(nameSpan.Slice(0, nameLength)); 1084return span.Slice(0, dataLength).ToArray(); 1092_ => span.Slice(0, dataLength).ToArray(), // This shouldn't happen, but the previous implementation included it defensively. 1125ReadOnlySpan<char> chars = MemoryMarshal.Cast<byte, char>(span.Slice(0, dataLength));
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
50return GetAndTrimString(stackBuffer.Slice(0, length));
PresentationCore (2)
System\Windows\Input\TextCompositionManager.cs (2)
414return new string(outputChars.Slice(0, charsWritten)); 866destination = destination.Slice(0, 1);
PresentationFramework (6)
MS\Internal\AppModel\ResourceContainer.cs (6)
210UpdateCachedRMW(key.Slice(0, assemblyName.Length), assembly); 216UpdateCachedRMW(key.Slice(0, assemblyName.Length + assemblyVersion.Length), assembly); 225UpdateCachedRMW(key.Slice(0, totalLength), assembly); 230UpdateCachedRMW(key.Slice(0, assemblyName.Length + assemblyToken.Length), assembly); 273if (!s_registeredResourceManagersLookup.TryGetValue(key.Slice(0, totalLength), out rmwResult)) 286s_registeredResourceManagersLookup[key.Slice(0, totalLength)] = rmwResult;
Roslyn.Diagnostics.Analyzers (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (4)
214GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 238GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 276GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 300GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (8)
762InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 768HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 773int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer!); 776IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit, comparer!); 1001InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1007HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1012int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1015IntroSort(keys.Slice(p + 1, partitionSize - (p + 1)), values.Slice(p + 1, partitionSize - (p + 1)), depthLimit);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (4)
1181? new BitHelper(span.Slice(0, intArrayLength), clear: true) 1249? new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) 1254? new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) 1336? new BitHelper(span.Slice(0, intArrayLength), clear: true)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
141tempBuffer = tempBuffer.Slice(0, charsWritten);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (2)
103var contentHash = bytes[HashIndex..HashSize].ToImmutableArray(); 104var position = BinaryPrimitives.ReadInt32LittleEndian(bytes[PositionIndex..]);
System.Collections (1)
System\Collections\Generic\SortedSet.cs (1)
1390new 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 (19)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\ConsolePal.Unix.cs (5)
534bracketPos = readBytes.Slice(0, semiPos).LastIndexOf((byte)'['); 535escPos = readBytes.Slice(0, bracketPos).LastIndexOf(Esc); 540TransferBytes(readBytes.Slice(0, escPos), r); 541TransferBytes(readBytes.Slice(escPos + 1, bracketPos - (escPos + 1)), r); 1137data = data.Slice(0, bytesToWrite);
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 (13)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\Diagnostics\Activity.GenerateRootId.netcoreapp.cs (1)
22return new string(result.Slice(0, 1 + charsWritten + s_uniqSuffix.Length));
System\Diagnostics\Metrics\TagList.netcore.cs (2)
205tags.Slice(index, _tagsCount - index).CopyTo(tags.Slice(index + 1)); 222tags.Slice(index + 1, _tagsCount - index - 1).CopyTo(tags.Slice(index));
System.Diagnostics.FileVersionInfo (1)
System\Diagnostics\FileVersionInfo.Unix.cs (1)
205parts = parts.Slice(0, versionSpan.Split(parts, '.'));
System.Diagnostics.PerformanceCounter (2)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
50return GetAndTrimString(stackBuffer.Slice(0, length));
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.GetComputerName.cs (1)
27buffer.Slice(0, (int)length).ToString() :
System.Diagnostics.Process (13)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetGroupList.cs (1)
31return groups.Slice(0, ngroups).ToArray();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
54return Encoding.UTF8.GetString(spanBuffer.Slice(0, resultLength));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\Diagnostics\Process.Linux.cs (1)
252ReadOnlySpan<byte> argRemainder = buffer.Slice(0, bytesRead);
System.Diagnostics.TextWriterTraceListener (3)
System\Diagnostics\XmlWriterTraceListener.cs (3)
83detail.CopyTo(dst.Slice(prefix.Length + 1, detail.Length)); 400writer.Write(span.Slice(0, charsWritten)); 424writer.Write(span.Slice(0, charsWritten));
System.DirectoryServices.Protocols (7)
System\DirectoryServices\Protocols\common\AsnWriterExtensions.cs (1)
24? stackalloc byte[StackAllocationThreshold].Slice(0, octetStringLength)
System\DirectoryServices\Protocols\common\DirectoryControl.cs (6)
173asnSpan = asnSpan.Slice(sequenceContentOffset, sequenceContentLength); 196result = AsnDecoder.ReadEnumeratedValue<ResultCode>(asnSpan.Slice(sequenceContentOffset, sequenceContentLength), AsnEncodingRules.BER, out bytesConsumed); 210asnSpan = asnSpan.Slice(sequenceContentOffset, sequenceContentLength); 235asnSpan = asnSpan.Slice(sequenceContentOffset, sequenceContentLength); 251attributeNameBuffer = attributeNameScratchSpace.Slice(0, octetStringLength); 276asnSpan = asnSpan.Slice(sequenceContentOffset, sequenceContentLength);
System.Drawing.Common (4)
_generated\3\Windows.Win32.byte.InlineArrays.g.cs (1)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
System\Drawing\Printing\PrinterSettings.cs (3)
743driver.AsSpan().CopyTo(names.Slice(offsetInChars, driver.Length)); 747printerName.AsSpan().CopyTo(names.Slice(offsetInChars, printerName.Length)); 751outPort.AsSpan().CopyTo(names.Slice(offsetInChars, outPort.Length));
System.Formats.Asn1 (27)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (2)
69Span<byte> toClear = Span.Slice(0, clearSize); 122Span = currentBuffer.Slice(0, length)
System\Formats\Asn1\AsnCharacterStringEncodings.net.cs (6)
49Span<byte> destination = write ? bytes.Slice(0, available) : Span<byte>.Empty; 85MemoryMarshal.Cast<char, ushort>(chars).Slice(0, available) : 290Span<byte> destination = write ? bytes.Slice(0, available) : Span<byte>.Empty; 330MemoryMarshal.Cast<char, ushort>(chars).Slice(0, available) : 493MemoryMarshal.Cast<byte, ushort>(bytes).Slice(0, available) : 529MemoryMarshal.Cast<char, ushort>(chars).Slice(0, available) :
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (2)
200stackSpan = stackSpan.Slice(0, sizeLimit); 227ReadOnlySpan<byte> valueSpan = stackSpan.Slice(0, bytesWritten);
System\Formats\Asn1\AsnDecoder.OctetString.cs (1)
527return tmpSpace.Slice(0, bytesWritten);
System\Formats\Asn1\AsnDecoder.Oid.cs (1)
203accumValueBytes.Slice(0, SemanticByteCount).CopyTo(writeSpan);
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (7)
96fraction = fraction.Slice(1, bytesWritten - 1); 125if (!Utf8Formatter.TryFormat(year, baseSpan.Slice(0, 4), out _, d4) || 126!Utf8Formatter.TryFormat(month, baseSpan.Slice(4, 2), out _, d2) || 127!Utf8Formatter.TryFormat(day, baseSpan.Slice(6, 2), out _, d2) || 128!Utf8Formatter.TryFormat(hour, baseSpan.Slice(8, 2), out _, d2) || 129!Utf8Formatter.TryFormat(minute, baseSpan.Slice(10, 2), out _, d2) || 130!Utf8Formatter.TryFormat(second, baseSpan.Slice(12, 2), out _, d2))
System\Formats\Asn1\AsnWriter.NamedBitList.cs (1)
182temp.Slice(0, byteLen),
System\Formats\Asn1\AsnWriter.Oid.cs (1)
217dest.Slice(0, idx).Reverse();
System\Formats\Asn1\AsnWriter.UtcTime.cs (6)
101if (!Utf8Formatter.TryFormat(year % 100, baseSpan.Slice(0, 2), out _, format) || 102!Utf8Formatter.TryFormat(month, baseSpan.Slice(2, 2), out _, format) || 103!Utf8Formatter.TryFormat(day, baseSpan.Slice(4, 2), out _, format) || 104!Utf8Formatter.TryFormat(hour, baseSpan.Slice(6, 2), out _, format) || 105!Utf8Formatter.TryFormat(minute, baseSpan.Slice(8, 2), out _, format) || 106!Utf8Formatter.TryFormat(second, baseSpan.Slice(10, 2), out _, format))
System.Formats.Cbor (5)
System\Formats\Cbor\Writer\CborWriter.Map.cs (2)
169ReadOnlySpan<byte> keyValuePairEncoding = source.Slice(range.Offset, range.TotalLength); 176tmpSpan.CopyTo(source.Slice(_frameOffset, totalMapPayloadEncodingLength));
System\Formats\Cbor\Writer\CborWriter.String.cs (3)
219buffer.Slice(offset, length).CopyTo(s); 227tempSpan.CopyTo(buffer.Slice(_offset, definiteLength)); 233buffer.Slice(_offset, initialOffset - _offset).Clear();
System.Formats.Nrbf (1)
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (1)
136Span<byte> resultAsBytes = MemoryMarshal.AsBytes<T>(valuesToRead.Slice(0, sliceSize));
System.Formats.Tar (36)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\Formats\Tar\TarHeader.Write.cs (26)
539return WriteAsUtf8String(name, buffer.Slice(FieldLocations.Name, FieldLengths.Name)); 558ReadOnlySpan<byte> pathNameBytes = encodingBuffer.Slice(0, encoded); 563return WriteLeftAlignedBytesAndGetChecksum(pathNameBytes, buffer.Slice(FieldLocations.Name, FieldLengths.Name)); 599int checksum = WriteLeftAlignedBytesAndGetChecksum(prefix, buffer.Slice(FieldLocations.Prefix, FieldLengths.Prefix)); 600checksum += WriteLeftAlignedBytesAndGetChecksum(name, buffer.Slice(FieldLocations.Name, FieldLengths.Name)); 620checksum += FormatNumeric(_mode, buffer.Slice(FieldLocations.Mode, FieldLengths.Mode)); 625checksum += FormatNumeric(_uid, buffer.Slice(FieldLocations.Uid, FieldLengths.Uid)); 630checksum += FormatNumeric(_gid, buffer.Slice(FieldLocations.Gid, FieldLengths.Gid)); 635checksum += FormatNumeric(_size, buffer.Slice(FieldLocations.Size, FieldLengths.Size)); 638checksum += WriteAsTimestamp(_mTime, buffer.Slice(FieldLocations.MTime, FieldLengths.MTime)); 659checksum += WriteAsUtf8String(linkName, buffer.Slice(FieldLocations.LinkName, FieldLengths.LinkName)); 684int checksum = WriteLeftAlignedBytesAndGetChecksum(UstarMagicBytes, buffer.Slice(FieldLocations.Magic, FieldLengths.Magic)); 685checksum += WriteLeftAlignedBytesAndGetChecksum(UstarVersionBytes, buffer.Slice(FieldLocations.Version, FieldLengths.Version)); 692int checksum = WriteLeftAlignedBytesAndGetChecksum(GnuMagicBytes, buffer.Slice(FieldLocations.Magic, FieldLengths.Magic)); 693checksum += WriteLeftAlignedBytesAndGetChecksum(GnuVersionBytes, buffer.Slice(FieldLocations.Version, FieldLengths.Version)); 717checksum += WriteAsUtf8String(uName, buffer.Slice(FieldLocations.UName, FieldLengths.UName)); 735checksum += WriteAsUtf8String(gName, buffer.Slice(FieldLocations.GName, FieldLengths.GName)); 740checksum += FormatNumeric(_devMajor, buffer.Slice(FieldLocations.DevMajor, FieldLengths.DevMajor)); 745checksum += FormatNumeric(_devMinor, buffer.Slice(FieldLocations.DevMinor, FieldLengths.DevMinor)); 758checksum += WriteAsTimestamp(_aTime, buffer.Slice(FieldLocations.ATime, FieldLengths.ATime)); 759checksum += WriteAsTimestamp(_cTime, buffer.Slice(FieldLocations.CTime, FieldLengths.CTime)); 792zeros = zeros.Slice(0, paddingAfterData); 875dataStream.Write(span.Slice(0, bytesWritten)); 932Span<byte> destination = buffer.Slice(FieldLocations.Checksum, FieldLengths.Checksum); 987destination.Slice(0, copyPos).Fill((byte)'0'); 1119return WriteLeftAlignedBytesAndGetChecksum(buffer.Slice(0, encoded), buffer);
System.IO.Compression (117)
System\IO\Compression\DeflateManaged\InflaterManaged.cs (1)
121bytes = 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\WinZipAesKeyMaterial.cs (3)
83byte[] encryptionKey = derivedKey.Slice(0, keySizeBytes).ToArray(); 84byte[] hmacKey = derivedKey.Slice(keySizeBytes, keySizeBytes).ToArray(); 85byte[] passwordVerifier = derivedKey.Slice(keySizeBytes + keySizeBytes, 2).ToArray();
System\IO\Compression\WinZipAesStream.cs (5)
215if (!CryptographicOperations.FixedTimeEquals(storedAuth, expectedAuth.Slice(0, storedAuth.Length))) 289Span<byte> dataSpan = buffer.Slice(0, bytesToProcess); 409Span<byte> readBuffer = buffer.Slice(0, bytesToRead); 415ProcessBlock(readBuffer.Slice(0, bytesRead)); 460ProcessBlock(buffer.Span.Slice(0, bytesRead));
System\IO\Compression\ZipArchive.cs (1)
676ReadOnlySpan<byte> sizedFileBuffer = fileBuffer.Slice(0, currBytesRead);
System\IO\Compression\ZipArchiveEntry.cs (38)
863ZipCentralDirectoryFileHeader.SignatureConstantBytes.CopyTo(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.Signature..]); 866BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.VersionNeededToExtract..], (ushort)_versionToExtract); 867BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.GeneralPurposeBitFlags..], (ushort)_generalPurposeBitFlag); 872BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.CompressionMethod..], compressionMethodToWrite); 874BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.LastModified..], ZipHelper.DateTimeToDosTime(_lastModified.DateTime)); 877BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.Crc32..], crcToWrite); 878BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.CompressedSize..], compressedSizeTruncated); 879BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.UncompressedSize..], uncompressedSizeTruncated); 880BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.FilenameLength..], (ushort)_storedEntryNameBytes.Length); 881BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.ExtraFieldLength..], extraFieldLength); 882BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.FileCommentLength..], (ushort)_fileComment.Length); 883BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.DiskNumberStart..], 0); 884BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.InternalFileAttributes..], 0); 885BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.ExternalFileAttributes..], _externalFileAttr); 886BinaryPrimitives.WriteUInt32LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.RelativeOffsetOfLocalHeader..], offsetOfLocalHeaderTruncated); 1735ZipLocalFileHeader.SignatureConstantBytes.CopyTo(lfStaticHeader[ZipLocalFileHeader.FieldLocations.Signature..]); 1736BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.VersionNeededToExtract..], (ushort)_versionToExtract); 1737BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.GeneralPurposeBitFlags..], (ushort)_generalPurposeBitFlag); 1741BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.CompressionMethod..], compressionMethodToWrite); 1743BinaryPrimitives.WriteUInt32LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.LastModified..], ZipHelper.DateTimeToDosTime(_lastModified.DateTime)); 1744BinaryPrimitives.WriteUInt32LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.Crc32..], crc32); 1745BinaryPrimitives.WriteUInt32LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.CompressedSize..], compressedSizeTruncated); 1746BinaryPrimitives.WriteUInt32LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.UncompressedSize..], uncompressedSizeTruncated); 1747BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.FilenameLength..], (ushort)_storedEntryNameBytes.Length); 1748BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.ExtraFieldLength..], extraFieldLength); 2071BinaryPrimitives.WriteUInt16LittleEndian(writeBuffer[relativeVersionToExtractLocation..], (ushort)_versionToExtract); 2072BinaryPrimitives.WriteUInt16LittleEndian(writeBuffer[relativeGeneralPurposeBitFlagsLocation..], (ushort)_generalPurposeBitFlag); 2086BinaryPrimitives.WriteUInt32LittleEndian(writeBuffer[relativeCrc32Location..], crcToWrite); 2087BinaryPrimitives.WriteUInt32LittleEndian(writeBuffer[relativeCompressedSizeLocation..], compressedSizeTruncated); 2088BinaryPrimitives.WriteUInt32LittleEndian(writeBuffer[relativeUncompressedSizeLocation..], uncompressedSizeTruncated); 2104BinaryPrimitives.WriteInt64LittleEndian(writeBuffer[relativeUncompressedSizeLocation..], _uncompressedSize); 2105BinaryPrimitives.WriteInt64LittleEndian(writeBuffer[relativeCompressedSizeLocation..], _compressedSize); 2139ZipLocalFileHeader.DataDescriptorSignatureConstantBytes.CopyTo(dataDescriptor[ZipLocalFileHeader.ZipDataDescriptor.FieldLocations.Signature..]); 2142BinaryPrimitives.WriteUInt32LittleEndian(dataDescriptor[ZipLocalFileHeader.ZipDataDescriptor.FieldLocations.Crc32..], crcToWrite); 2146BinaryPrimitives.WriteInt64LittleEndian(dataDescriptor[ZipLocalFileHeader.Zip64DataDescriptor.FieldLocations.CompressedSize..], _compressedSize); 2147BinaryPrimitives.WriteInt64LittleEndian(dataDescriptor[ZipLocalFileHeader.Zip64DataDescriptor.FieldLocations.UncompressedSize..], _uncompressedSize); 2153BinaryPrimitives.WriteUInt32LittleEndian(dataDescriptor[ZipLocalFileHeader.ZipDataDescriptor.FieldLocations.CompressedSize..], (uint)_compressedSize); 2154BinaryPrimitives.WriteUInt32LittleEndian(dataDescriptor[ZipLocalFileHeader.ZipDataDescriptor.FieldLocations.UncompressedSize..], (uint)_uncompressedSize);
System\IO\Compression\ZipBlocks.cs (58)
40BinaryPrimitives.WriteUInt16LittleEndian(extraFieldHeader[FieldLocations.Tag..], _tag); 41BinaryPrimitives.WriteUInt16LittleEndian(extraFieldHeader[FieldLocations.Size..], _size); 416BinaryPrimitives.WriteUInt16LittleEndian(extraFieldData[FieldLocations.Tag..], TagConstant); 417BinaryPrimitives.WriteUInt16LittleEndian(extraFieldData[FieldLocations.Size..], _size); 421BinaryPrimitives.WriteInt64LittleEndian(extraFieldData[startOffset..], _uncompressedSize.Value); 427BinaryPrimitives.WriteInt64LittleEndian(extraFieldData[startOffset..], _compressedSize.Value); 433BinaryPrimitives.WriteInt64LittleEndian(extraFieldData[startOffset..], _localHeaderOffset.Value); 439BinaryPrimitives.WriteUInt32LittleEndian(extraFieldData[startOffset..], _startDiskNumber.Value); 474NumberOfDiskWithZip64EOCD = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.NumberOfDiskWithZip64EOCD..]), 475OffsetOfZip64EOCD = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.OffsetOfZip64EOCD..]), 476TotalNumberOfDisks = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.TotalNumberOfDisks..]) 495SignatureConstantBytes.CopyTo(blockContents[FieldLocations.Signature..]); 497BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.NumberOfDiskWithZip64EOCD..], 0); 498BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.OffsetOfZip64EOCD..], zip64EOCDRecordStart); 500BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.TotalNumberOfDisks..], 1); 547SizeOfThisRecord = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.SizeOfThisRecord..]), 548VersionMadeBy = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.VersionMadeBy..]), 549VersionNeededToExtract = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.VersionNeededToExtract..]), 550NumberOfThisDisk = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.NumberOfThisDisk..]), 551NumberOfDiskWithStartOfCD = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.NumberOfDiskWithStartOfCD..]), 552NumberOfEntriesOnThisDisk = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.NumberOfEntriesOnThisDisk..]), 553NumberOfEntriesTotal = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.NumberOfEntriesTotal..]), 554SizeOfCentralDirectory = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.SizeOfCentralDirectory..]), 555OffsetOfCentralDirectory = BinaryPrimitives.ReadUInt64LittleEndian(blockContents[FieldLocations.OffsetOfCentralDirectory..]) 575SignatureConstantBytes.CopyTo(blockContents[FieldLocations.Signature..]); 576BinaryPrimitives.WriteUInt64LittleEndian(blockContents[FieldLocations.SizeOfThisRecord..], NormalSize); 578BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.VersionMadeBy..], (ushort)ZipVersionNeededValues.Zip64); 580BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.VersionNeededToExtract..], (ushort)ZipVersionNeededValues.Zip64); 582BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.NumberOfThisDisk..], 0); 584BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.NumberOfDiskWithStartOfCD..], 0); 586BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.NumberOfEntriesOnThisDisk..], numberOfEntries); 588BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.NumberOfEntriesTotal..], numberOfEntries); 589BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.SizeOfCentralDirectory..], sizeOfCentralDirectory); 590BinaryPrimitives.WriteInt64LittleEndian(blockContents[FieldLocations.OffsetOfCentralDirectory..], startOfCentralDirectory); 619filenameLength = BinaryPrimitives.ReadUInt16LittleEndian(fixedHeaderBuffer[relativeFilenameLengthLocation..]); 620extraFieldLength = BinaryPrimitives.ReadUInt16LittleEndian(fixedHeaderBuffer[relativeExtraFieldLengthLocation..]); 644Span<byte> extraFieldBuffer = extraFieldLength <= StackAllocationThreshold ? stackalloc byte[StackAllocationThreshold].Slice(0, extraFieldLength) : arrayPoolBuffer.AsSpan(0, extraFieldLength); 687ushort filenameLength = BinaryPrimitives.ReadUInt16LittleEndian(blockBytes[relativeFilenameLengthLocation..]); 688ushort extraFieldLength = BinaryPrimitives.ReadUInt16LittleEndian(blockBytes[relativeExtraFieldLengthLocation..]); 1026Span<byte> collatedHeader = dynamicHeaderSize <= StackAllocationThreshold ? stackalloc byte[StackAllocationThreshold].Slice(0, dynamicHeaderSize) : arrayPoolBuffer.AsSpan(0, dynamicHeaderSize); 1030Debug.Assert(bytesToRead == collatedHeader[remainingBufferLength..].Length); 1031int realBytesRead = furtherReads.ReadAtLeast(collatedHeader[remainingBufferLength..], bytesToRead, throwOnEndOfStream: false); 1089SignatureConstantBytes.CopyTo(blockContents[FieldLocations.Signature..]); 1091BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.NumberOfThisDisk..], 0); 1093BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.NumberOfTheDiskWithTheStartOfTheCentralDirectory..], 0); 1095BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.NumberOfEntriesInTheCentralDirectoryOnThisDisk..], numberOfEntriesTruncated); 1097BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.NumberOfEntriesInTheCentralDirectory..], numberOfEntriesTruncated); 1098BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.SizeOfCentralDirectory..], sizeOfCentralDirectoryTruncated); 1099BinaryPrimitives.WriteUInt32LittleEndian(blockContents[FieldLocations.OffsetOfStartOfCentralDirectoryWithRespectToTheStartingDiskNumber..], startOfCentralDirectoryTruncated); 1105BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.ArchiveCommentLength..], (ushort)archiveComment.Length); 1137Signature = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.Signature..]), 1138NumberOfThisDisk = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.NumberOfThisDisk..]), 1139NumberOfTheDiskWithTheStartOfTheCentralDirectory = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.NumberOfTheDiskWithTheStartOfTheCentralDirectory..]), 1140NumberOfEntriesInTheCentralDirectoryOnThisDisk = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.NumberOfEntriesInTheCentralDirectoryOnThisDisk..]), 1141NumberOfEntriesInTheCentralDirectory = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.NumberOfEntriesInTheCentralDirectory..]), 1142SizeOfCentralDirectory = BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.SizeOfCentralDirectory..]), 1144BinaryPrimitives.ReadUInt32LittleEndian(blockContents[FieldLocations.OffsetOfStartOfCentralDirectoryWithRespectToTheStartingDiskNumber..]) 1147ushort commentLength = BinaryPrimitives.ReadUInt16LittleEndian(blockContents[FieldLocations.ArchiveCommentLength..]);
System\IO\Compression\ZipCryptoStream.Random.cs (1)
15RandomNumberGenerator.Fill(header.Slice(0, 10));
System\IO\Compression\ZipCustomStreams.cs (2)
580ProcessBytesRead(buffer.Slice(0, bytesRead)); 609ProcessBytesRead(buffer.Span.Slice(0, bytesRead));
System\IO\Compression\ZipHelper.cs (2)
122bufferSpan = bufferSpan.Slice(0, maxBytesToRead - totalBytesRead + overlap); 130bufferSpan = bufferSpan.Slice(0, bytesRead);
System\IO\Compression\Zstandard\ZstandardStream.Compress.cs (1)
139_stream.Write(output.Slice(0, bytesWritten));
System\IO\Compression\Zstandard\ZstandardStream.Decompress.cs (3)
234: _stream.ReadAtLeast(_buffer.AvailableSpan.Slice(0, needed), needed, throwOnEndOfStream: false); 258if (_decoder.Decompress(_buffer.ActiveSpan.Slice(0, ZstdFrameMagicLength), _buffer.AvailableSpan.Slice(0, 1), out int bytesConsumed, out _) == OperationStatus.NeedMoreData)
System.IO.Compression.Brotli (2)
System\IO\Compression\enc\BrotliStream.Compress.cs (2)
95_stream.Write(output.Slice(0, bytesWritten)); 203_stream.Write(output.Slice(0, bytesWritten));
System.IO.FileSystem.AccessControl (11)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
50return GetAndTrimString(stackBuffer.Slice(0, length));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System.IO.FileSystem.Watcher (11)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\IO\FileSystemWatcher.Linux.cs (1)
1379return pathBuffer.Slice(0, length);
System.IO.Hashing (4)
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (4)
166GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 190GetCurrentHashCore(destination.Slice(0, HashLengthInBytes)); 228GetHashAndResetCore(destination.Slice(0, HashLengthInBytes)); 252GetHashAndResetCore(destination.Slice(0, HashLengthInBytes));
System.IO.MemoryMappedFiles (1)
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (1)
262guid.Slice(0, MaxNameLength - NamePrefix.Length).CopyTo(span.Slice(NamePrefix.Length));
System.Linq (1)
System\Linq\SegmentedArrayBuilder.cs (1)
328_currentSegment.Slice(0, _countInCurrentSegment).CopyTo(destination);
System.Memory (2)
System\Buffers\ReadOnlySequence.Helpers.cs (2)
229return ((MemoryManager<T>)startObject).Memory.Span.Slice(startIndex, endIndex - startIndex); 694return ((MemoryManager<T>)startObject).Memory.Span.Slice(startIndex, endIndex - startIndex);
System.Net.Http (42)
src\runtime\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\runtime\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\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_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)
646stream.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\DecompressionHandler.cs (1)
45_acceptEncodingHeaderValue = string.Join(", ", methods.Slice(0, count));
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (7)
457string response = Encoding.ASCII.GetString(_incomingBuffer.ActiveSpan.Slice(0, Math.Min(20, _incomingBuffer.ActiveLength))); 683GetFrameData(_incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength), frameHeader.PaddedFlag, frameHeader.PriorityFlag), 699_incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength), 767ReadOnlySpan<byte> span = _incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength); 800ReadOnlySpan<byte> frameData = GetFrameData(_incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength), hasPad: frameHeader.PaddedFlag, hasPriority: false); 854ReadOnlySpan<byte> settings = _incomingBuffer.ActiveSpan.Slice(0, frameHeader.PayloadLength); 1016ReadOnlySpan<byte> pingContent = _incomingBuffer.ActiveSpan.Slice(0, FrameHeader.PingLength);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (1)
531return buffer.Slice(0, 4 + integerLength).ToArray();
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (5)
752int actualHeadersLengthEncodedSize = VariableLengthIntegerHelper.WriteInteger(_sendBuffer.ActiveSpan.Slice(1, headersLengthEncodedSize), headersLength); 982_headerDecoder.Decode(_recvBuffer.ActiveSpan.Slice(0, processLength), endHeaders, this); 1218_recvBuffer.ActiveSpan.Slice(0, copyLen).CopyTo(buffer); 1238int bytesRead = _stream.Read(buffer.Slice(0, copyLen)); 1290_recvBuffer.ActiveSpan.Slice(0, copyLen).CopyTo(buffer.Span);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (5)
1048ParseStatusLineCore(buffer.Slice(0, length), response); 1099throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_code, Encoding.ASCII.GetString(line.Slice(9, 3)))); 1210ReadOnlySpan<byte> headerName = buffer.Slice(0, valueStartIdx - 1); 1211ReadOnlySpan<byte> headerValue = buffer.Slice(valueStartIdx, buffer.Length - valueIterator.Length + crOrLfIdx - valueStartIdx); 1538return WriteAsync(temp.Slice(0, bytesWritten).ToArray());
System.Net.Http.WinHttpHandler (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
50return GetAndTrimString(stackBuffer.Slice(0, length));
System.Net.HttpListener (1)
System\Net\HttpListener.cs (1)
209OperationStatus operationStatus = Ascii.ToLowerInPlace(destination.Slice(0, toLowerLength), out _);
System.Net.Mail (14)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\Net\Base64Stream.cs (2)
183read = DecodeBytes(buffer.Slice(0, read)); 206read = DecodeBytes(buffer.Span.Slice(0, read));
System\Net\Mail\SmtpReplyReaderFactory.cs (2)
246int actual = ProcessRead(buffer.Slice(0, read), false); 249_bufferedStream.Push(buffer.Slice(actual, read - actual));
System.Net.NameResolution (10)
System\Net\DnsEncodedName.cs (6)
137OperationStatus asciiStatus = Ascii.FromUtf16(name, destination.Slice(1, name.Length), out _); 141Span<byte> body = destination.Slice(1, name.Length); 146int dotIdx = body[labelStart..].IndexOf((byte)'.'); 149Span<byte> label = body.Slice(labelStart, labelLen); 348label.CopyTo(destination[bytesWritten..]); 400Span<char> labelChars = destination.Slice(charsWritten, label.Length);
System\Net\DnsMessageWriter.cs (4)
26if (!header.TryWrite(_destination[_bytesWritten..])) 43Span<byte> destination = _destination[_bytesWritten..]; 51BinaryPrimitives.WriteUInt16BigEndian(_destination[_bytesWritten..], (ushort)type); 54BinaryPrimitives.WriteUInt16BigEndian(_destination[_bytesWritten..], (ushort)@class);
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
313return CreatePingReply(IPStatus.TtlExpired, IPEndPointExtensions.GetIPAddress(socketAddress.Slice(0, header.SocketAddressLen)));
System.Net.Primitives (5)
src\runtime\src\libraries\Common\src\System\Net\NetworkInformation\InterfaceInfoPal.Unix.cs (1)
48.Slice(0, bufferSize);
src\runtime\src\libraries\Common\src\System\Net\SocketAddress.cs (1)
200return result.Slice(0, length).ToString();
System\Net\IPAddress.cs (3)
469_toString = toString = new string(span.Slice(0, length)); 526if (tmpDestination.Slice(0, written).TryCopyTo(destination)) 722ReadOnlySpan<byte> numbers = MemoryMarshal.AsBytes<ushort>(_numbers).Slice(0, 16);
System.Net.Quic (1)
System\Net\Quic\Internal\ReceiveBuffers.cs (1)
58quicBuffer = quicBuffer.Slice(0, totalLength);
System.Net.Requests (1)
System\Net\HttpWebResponse.cs (1)
403int readBytes = innerStream.Read(buffer.Slice(0, (int)Math.Min(buffer.Length, _maxRemainingLength)));
System.Net.Security (25)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (2)
523if (!Ssl.SslAddClientCAs(sslHandle, handles.Slice(0, certList.Count))) 1235Span<byte> clientProto = clientList.Slice(1, length);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (2)
99return algorithms.Slice(0, algorithmCount).ToArray(); 363Span<byte> buffer = (uint)length <= 256 ? stackalloc byte[256].Slice(0, length) : new byte[length];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (2)
69Span<byte> toClear = Span.Slice(0, clearSize); 122Span = currentBuffer.Slice(0, length)
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (14)
458Span<byte> blob = payload.Slice(payloadOffset, sizeof(NtChallengeResponse) + serverInfo.Length); 459ref NtChallengeResponse temp = ref MemoryMarshal.AsRef<NtChallengeResponse>(blob.Slice(0, sizeof(NtChallengeResponse))); 697ref AuthenticateMessage response = ref MemoryMarshal.AsRef<AuthenticateMessage>(responseAsSpan.Slice(0, sizeof(AuthenticateMessage))); 720payload.Slice(payloadOffset, ChallengeResponseLength).Clear(); 741int sessionKeyWritten = HMACMD5.HashData(ntlm2hash, responseAsSpan.Slice(response.NtChallengeResponse.PayloadOffset, 16), sessionBaseKey); 747Span<byte> encryptedRandomSessionKey = payload.Slice(payloadOffset, 16); 800hmac.AppendData(signature.Slice(12, 4)); 804seal.Transform(hmacResult.Slice(0, 8), signature.Slice(4, 8)); 846_clientSeal.Transform(input, output.Slice(SignatureLength, input.Length)); 847CalculateSignature(input, _clientSequenceNumber, _clientSigningKey, _clientSeal, output.Slice(0, SignatureLength)); 871_serverSeal.Transform(input.Slice(SignatureLength), output.Slice(0, input.Length - SignatureLength)); 872if (!VerifyMIC(output.Slice(0, input.Length - SignatureLength), input.Slice(0, SignatureLength))) 900if (!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)
1085NetEventSource.DumpBuffer(this, destination.Slice(0, bytesWritten));
System\Net\Security\TlsSession.cs (1)
1566_pendingBuffer.ActiveSpan.Slice(0, n).CopyTo(output);
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)
160new IPAddress((long)SocketAddressPal.GetIPv4Address(buffer.Slice(0, bufferLength)) & 0x0FFFFFFFF), 166SocketAddressPal.GetIPv6Address(buffer.Slice(0, bufferLength), address, out uint scope); 175_rightEndPoint = new UnixDomainSocketEndPoint(buffer.Slice(0, bufferLength)); 194new IPAddress((long)SocketAddressPal.GetIPv4Address(buffer.Slice(0, bufferLength)) & 0x0FFFFFFFF), 200SocketAddressPal.GetIPv6Address(buffer.Slice(0, bufferLength), address, out uint scope); 209_remoteEndPoint = new UnixDomainSocketEndPoint(buffer.Slice(0, bufferLength)); 329_localEndPoint = IPEndPointExtensions.CreateIPEndPoint(buffer.Slice(0, size)); 334buffer.Slice(0, size).CopyTo(socketAddress.Buffer.Span); 375_remoteEndPoint = IPEndPointExtensions.CreateIPEndPoint(buffer.Slice(0, size)); 380buffer.Slice(0, size).CopyTo(socketAddress.Buffer.Span); 816socketAddress.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)
382url = url.Slice(0, charsWritten);
System.Net.WebSockets (11)
System\Net\WebSockets\Compression\WebSocketDeflater.cs (1)
106Debug.Assert(output.Slice(written - WebSocketInflater.FlushMarkerLength, WebSocketInflater.FlushMarkerLength)
System\Net\WebSockets\Compression\WebSocketInflater.cs (1)
195written += Inflate(_stream, output[written..], FlushCode.SyncFlush, out _);
System\Net\WebSockets\ManagedWebSocket.cs (9)
926_receiveBuffer.Span.Slice(_receiveBufferOffset, receiveBufferBytesToCopy).CopyTo( 955_inflater!.Span.Slice(0, totalBytesReceived) : 956payloadBuffer.Span.Slice(0, totalBytesReceived), header.Mask, _receivedMaskOffsetOffset); 981!TryValidateUtf8(payloadBuffer.Span.Slice(0, totalBytesReceived), header.EndOfMessage, _utf8TextState)) 1099ApplyMask(_receiveBuffer.Span.Slice(_receiveBufferOffset, (int)header.PayloadLength), header.Mask, 0); 1112closeStatusDescription = s_textEncoding.GetString(_receiveBuffer.Span.Slice(_receiveBufferOffset + 2, (int)header.PayloadLength - 2)); 1203ApplyMask(_receiveBuffer.Span.Slice(_receiveBufferOffset, (int)header.PayloadLength), header.Mask, 0); 1222long pongPayload = BinaryPrimitives.ReadInt64BigEndian(_receiveBuffer.Span.Slice(_receiveBufferOffset, (int)header.PayloadLength)); 1613_receiveBuffer.Span.Slice(_receiveBufferOffset, _receiveBufferCount).CopyTo(_receiveBuffer.Span);
System.Numerics.Tensors (18)
System\Buffers\NIndex.cs (1)
181return new string(span.Slice(0, charsWritten + 1));
System\Buffers\NRange.cs (1)
88return new string(span.Slice(0, pos));
System\Numerics\Tensors\netcore\Tensor.cs (6)
1953tensor.Lengths[(dimension + 1)..].CopyTo(lengths[dimension..]); 1956tensor.Strides[(dimension + 1)..].CopyTo(strides[dimension..]); 2020tensor.Lengths[(dimension + 1)..].CopyTo(lengths[dimension..]); 2023tensor.Strides[(dimension + 1)..].CopyTo(strides[dimension..]); 2087tensor.Lengths[(dimension + 1)..].CopyTo(lengths[dimension..]); 2090tensor.Strides[(dimension + 1)..].CopyTo(strides[dimension..]);
System\Numerics\Tensors\netcore\TensorPrimitives.IsCanonical.cs (1)
28destination.Slice(0, x.Length).Fill(true);
System\Numerics\Tensors\netcore\TensorPrimitives.IsComplexNumber.cs (1)
28destination.Slice(0, x.Length).Clear();
System\Numerics\Tensors\netcore\TensorPrimitives.IsFinite.cs (1)
28destination.Slice(0, x.Length).Fill(true);
System\Numerics\Tensors\netcore\TensorPrimitives.IsImaginaryNumber.cs (1)
28destination.Slice(0, x.Length).Clear();
System\Numerics\Tensors\netcore\TensorPrimitives.IsInteger.cs (1)
28destination.Slice(0, x.Length).Fill(true);
System\Numerics\Tensors\netcore\TensorPrimitives.IsNaN.cs (1)
28destination.Slice(0, x.Length).Clear();
System\Numerics\Tensors\netcore\TensorPrimitives.IsNegative.cs (1)
28destination.Slice(0, x.Length).Clear();
System\Numerics\Tensors\netcore\TensorPrimitives.IsRealNumber.cs (1)
28destination.Slice(0, x.Length).Fill(true);
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (2)
33if (destination1.Slice(0, inputLength).Overlaps(destination2.Slice(0, inputLength)))
System.Private.CoreLib (294)
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.CoreCLR.cs (3)
624callstackSpanIndex += Serializer.WriteCompressedUInt64(callstackSpan.Slice(callstackSpanIndex, Serializer.MaxCompressedUInt64Size), currentNativeIP); 628callstackSpanIndex += Serializer.WriteCompressedInt64(callstackSpan.Slice(callstackSpanIndex, Serializer.MaxCompressedInt64Size), (long)(currentNativeIP - previousNativeIP)); 643callstackSpanIndex += Serializer.WriteCompressedInt64(callstackSpan.Slice(callstackSpanIndex, Serializer.MaxCompressedInt64Size), (long)(currentNativeIP - previousNativeIP));
src\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (1)
36return groups.Slice(0, rv).Contains(gid);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (1)
45: buffer.Slice(0, charsWritten);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
54return Encoding.UTF8.GetString(spanBuffer.Slice(0, resultLength));
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (3)
257WriteTwoDigits(value, buffer.Slice(index, 2)); 1021Span<TChar> groupBuffer = buffer.Slice(groupStartWrite, digitsInGroup); 1041sGroup.CopyTo(buffer.Slice(writePos, sGroup.Length));
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
252parts = parts.Slice(0, attributeValueSpan.Split(parts, '.'));
src\runtime\src\libraries\Common\src\System\Sha1ForNonSecretPurposes.cs (1)
56tail = tail.Slice(0, pos + 8);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.cs (1)
3073new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (2)
189return destination.Slice(0, 2); 192return destination.Slice(0, 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Decoder.cs (2)
113byte[] result = destination.Slice(0, bytesWritten).ToArray(); 245byte[] result = destination.Slice(0, bytesWritten).ToArray();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (2)
576status = DecodeFrom<TBase64Decoder, byte>(decoder, buffer.Slice(0, bufferIdx), bytes, out int localConsumed, out int localWritten, localIsFinalBlock, ignoreWhiteSpace: false); 681status = DecodeFrom(decoder, buffer.Slice(0, bufferIdx), bytes, out int localConsumed, out int localWritten, localIsFinalBlock, ignoreWhiteSpace: false);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlDecoder.cs (2)
173byte[] ret = destination.Slice(0, bytesWritten).ToArray(); 270byte[] ret = destination.Slice(0, bytesWritten).ToArray();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (1)
109Ascii.ToLowerInPlace(destination.Slice(0, bytesWritten), out bytesWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (7)
535Span<int> thisRemaining = MemoryMarshal.Cast<byte, int>(((Span<byte>)thisArray).Slice(i, roundedBytesRemaining)); 536Span<int> valueRemaining = MemoryMarshal.Cast<byte, int>(((Span<byte>)valueArray).Slice(i, roundedBytesRemaining)); 633intSpan.Slice((int)fromIndex, ints - fromIndex).CopyTo(intSpan); 653intSpan.Slice(toIndex, ints - toIndex).Clear(); 685intSpan.Slice(0, lastIndex + 1 - lengthToClear).CopyTo(intSpan.Slice(lengthToClear)); 708intSpan.Slice(0, lengthToClear).Clear(); 777Span<int> source = MemoryMarshal.Cast<byte, int>((Span<byte>)_array).Slice(0, intLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (27)
160InsertionSort(keys.Slice(0, partitionSize), comparer); 166HeapSort(keys.Slice(0, partitionSize), comparer); 171int p = PickPivotAndPartition(keys.Slice(0, partitionSize), comparer); 439InsertionSort(keys.Slice(0, partitionSize)); 445HeapSort(keys.Slice(0, partitionSize)); 450int p = PickPivotAndPartition(keys.Slice(0, partitionSize)); 704InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 710HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 715int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 933InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 939HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 944int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize)); 1228InsertionSort(keys.Slice(0, partitionSize), comparer); 1234HeapSort(keys.Slice(0, partitionSize), comparer); 1239int p = PickPivotAndPartition(keys.Slice(0, partitionSize), comparer); 1441InsertionSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 1447HeapSort(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer); 1452int p = PickPivotAndPartition(keys.Slice(0, partitionSize), values.Slice(0, partitionSize), comparer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (4)
1592new BitHelper(span.Slice(0, intArrayLength), clear: true) : 1660new BitHelper(itemsToRemoveSpan.Slice(0, intArrayLength), clear: true) : 1665new BitHelper(itemsAddedFromOtherSpan.Slice(0, intArrayLength), clear: true) : 1748new BitHelper(span.Slice(0, intArrayLength), clear: true) :
src\runtime\src\libraries\System.Private.CoreLib\src\System\Convert.cs (2)
2689destination = destination.Slice(0, quotient); 2745destination = destination.Slice(0, quotient);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
624buffer = buffer.Slice(0, 16);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (1)
1077Span<uint> num = rgulNum.Slice(0, hiProd + 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
1787return new Guid(bytes.Slice(0, 16));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ManifestBuilder.cs (2)
460ReadOnlySpan<char> hexValueFormatted = ulongHexScratch.Slice(0, charsWritten); 507ReadOnlySpan<char> keywordFormatted = ulongHexScratch.Slice(0, charsWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (2)
1946foundItems = foundItems.Slice(0, foundItemsCount); 1990foundItems = foundItems.Slice(0, foundItemsCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (3)
166return IsSortable(valueAsUtf16.Slice(0, charCount)); 1038return IndexOf(source, valueAsUtf16.Slice(0, charCount), options); 1410return LastIndexOf(source, valueAsUtf16.Slice(0, charCount), options);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (2)
34return SearchValues.Create(values.Slice(0, valueIndex)); 934int hash = Marvin.ComputeHash32(sortKey.Slice(0, sortKeyLength), Marvin.DefaultSeed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Invariant.cs (1)
69Span<byte> tmp = sortKey.Slice(0, 2 * sizeof(ushort)); // help with bounds check elimination
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (1)
160int hash = Marvin.ComputeHash32(span.Slice(0, sortKeyLength), Marvin.DefaultSeed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Utf8.cs (2)
108sourceUtf16 = sourceUtf16.Slice(0, sourceUtf16Length); 145prefixUtf16 = prefixUtf16.Slice(0, prefixUtf16Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (2)
106return changed ? new string(buffer.Slice(0, bufferIndex)) : name; 449return result.Slice(0, resultPos).ToString();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (54)
787result.Append(chars.Slice(0, charCount)); 844Number.WriteTwoDigits((uint)offset.Hours, offsetSpan.Slice(0, 2)); 846Number.WriteTwoDigits((uint)offset.Minutes, offsetSpan.Slice(3, 2)); 888Number.WriteTwoDigits((uint)offset.Hours, hoursMinutes.Slice(0, 2)); 890Number.WriteTwoDigits((uint)offset.Minutes, hoursMinutes.Slice(3, 2)); 977return span.Slice(0, charsWritten).ToString(); 1338Number.WriteTwoDigits((uint)hour, destination.Slice(0, 2)); 1340Number.WriteTwoDigits((uint)minute, destination.Slice(3, 2)); 1342Number.WriteTwoDigits((uint)second, destination.Slice(6, 2)); 1344Number.WriteDigits((uint)fraction, destination.Slice(9, 7)); 1363Number.WriteTwoDigits((uint)hour, destination.Slice(0, 2)); 1365Number.WriteTwoDigits((uint)minute, destination.Slice(3, 2)); 1367Number.WriteTwoDigits((uint)second, destination.Slice(6, 2)); 1387Number.WriteFourDigits((uint)year, destination.Slice(0, 4)); 1389Number.WriteTwoDigits((uint)month, destination.Slice(5, 2)); 1391Number.WriteTwoDigits((uint)day, destination.Slice(8, 2)); 1423Number.WriteTwoDigits((uint)day, destination.Slice(5, 2)); 1430Number.WriteFourDigits((uint)year, destination.Slice(12, 4)); 1475Span<TChar> dest = destination.Slice(0, FormatOMinLength); 1477Number.WriteFourDigits((uint)year, dest.Slice(0, 4)); 1479Number.WriteTwoDigits((uint)month, dest.Slice(5, 2)); 1481Number.WriteTwoDigits((uint)day, dest.Slice(8, 2)); 1484Number.WriteTwoDigits((uint)hour, dest.Slice(11, 2)); 1486Number.WriteTwoDigits((uint)minute, dest.Slice(14, 2)); 1488Number.WriteTwoDigits((uint)second, dest.Slice(17, 2)); 1490Number.WriteDigits((uint)tick, dest.Slice(20, 7)); 1505Span<TChar> suffix = destination.Slice(FormatOMinLength, 6); 1507Number.WriteTwoDigits((uint)offsetHours, suffix.Slice(1, 2)); 1509Number.WriteTwoDigits((uint)offsetMinutes, suffix.Slice(4, 2)); 1535Number.WriteFourDigits((uint)year, destination.Slice(0, 4)); 1537Number.WriteTwoDigits((uint)month, destination.Slice(5, 2)); 1539Number.WriteTwoDigits((uint)day, destination.Slice(8, 2)); 1542Number.WriteTwoDigits((uint)hour, destination.Slice(11, 2)); 1544Number.WriteTwoDigits((uint)minute, destination.Slice(14, 2)); 1546Number.WriteTwoDigits((uint)second, destination.Slice(17, 2)); 1572Number.WriteFourDigits((uint)year, destination.Slice(0, 4)); 1574Number.WriteTwoDigits((uint)month, destination.Slice(5, 2)); 1576Number.WriteTwoDigits((uint)day, destination.Slice(8, 2)); 1579Number.WriteTwoDigits((uint)hour, destination.Slice(11, 2)); 1581Number.WriteTwoDigits((uint)minute, destination.Slice(14, 2)); 1583Number.WriteTwoDigits((uint)second, destination.Slice(17, 2)); 1623Number.WriteTwoDigits((uint)day, destination.Slice(5, 2)); 1630Number.WriteFourDigits((uint)year, destination.Slice(12, 4)); 1633Number.WriteTwoDigits((uint)hour, destination.Slice(17, 2)); 1635Number.WriteTwoDigits((uint)minute, destination.Slice(20, 2)); 1637Number.WriteTwoDigits((uint)second, destination.Slice(23, 2)); 1673Number.WriteTwoDigits((uint)month, destination.Slice(0, 2)); 1675Number.WriteTwoDigits((uint)day, destination.Slice(3, 2)); 1677Number.WriteFourDigits((uint)year, destination.Slice(6, 4)); 1681Number.WriteTwoDigits((uint)hour, destination.Slice(11, 2)); 1683Number.WriteTwoDigits((uint)minute, destination.Slice(14, 2)); 1685Number.WriteTwoDigits((uint)second, destination.Slice(17, 2)); 1700Number.WriteTwoDigits((uint)offsetHours, destination.Slice(21, 2)); 1702Number.WriteTwoDigits((uint)offsetMinutes, destination.Slice(24, 2));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (2)
30return GetStringForOutput(unicodeString, unicode, outputStack.Slice(0, actualLength)); 112return GetStringForOutput(asciiString, ascii, output.Slice(0, realLen));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (2)
52return GetStringForOutput(unicodeString, unicode, output.Slice(0, length)); 126return GetStringForOutput(asciiString, ascii, output.Slice(0, length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (1)
89ReadOnlySpan<char> result = buffer.Slice(0, realLen);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (1)
72ReadOnlySpan<char> result = buffer.Slice(0, realLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (14)
88return new string(destination.Slice(0, charsWritten)); 99return new string(destination.Slice(0, charsWritten)); 243Number.WriteDigits(days, destination.Slice(pos, dayDigits)); 270Span<TChar> suffix = destination.Slice(pos, suffixLen); 272Number.WriteTwoDigits(hours, suffix.Slice(0, 2)); 274Number.WriteTwoDigits((uint)minutes, suffix.Slice(3, 2)); 276Number.WriteTwoDigits((uint)seconds, suffix.Slice(6, 2)); 290decimalSeparator.CopyTo(suffix.Slice(8, decSepLen)); 293Number.WriteDigits(fraction, suffix.Slice(8 + decSepLen, fractionDigits)); 311Span<TChar> suffix = destination.Slice(pos, suffixLen); 315Number.WriteTwoDigits((uint)minutes, suffix.Slice(2, 2)); 317Number.WriteTwoDigits((uint)seconds, suffix.Slice(5, 2)); 331decimalSeparator.CopyTo(suffix.Slice(7, decSepLen)); 334Number.WriteDigits(fraction, suffix.Slice(7 + decSepLen, fractionDigits));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (1)
989return Unsafe.BitCast<ReadOnlySpan<byte>, ReadOnlySpan<TChar>>(destUtf8Span.Slice(0, newLength));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Index.cs (1)
162return new string(span.Slice(0, charsWritten + 1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (3)
189OutStream.Write(buffer.Slice(0, utf8ByteCount)); 203OutStream.Write(buffer.Slice(0, actualByteCount)); 365OutStream.Write(buffer.Slice(0, actualByteCount + 1 /* length prefix */));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (2)
42path.Slice(pos, 6).Fill((byte)'X'); 56return Encoding.UTF8.GetString(path.Slice(0, path.Length - 1)); // trim off the trailing '\0'
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (1)
90_fullPath = _pathBuffer.Slice(0, charsWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (2)
1543return buffer.Slice(0, bytesRead).ToArray(); 1596Span<byte> toStore = bytes.Slice(0, preambleSize + encoded);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
121return Encoding.UTF8.GetString(path.Slice(0, path.Length - 1)); // trim off the trailing '\0'
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\RandomAccess.Unix.cs (1)
185stackalloc Interop.Sys.IOVector[IovStackThreshold].Slice(0, buffersCount) :
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
346_stream.Write(byteBuffer.Slice(0, count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\WritableMemoryStream.cs (5)
122_memory.Span.Slice(_position, bytesToRead).CopyTo(buffer); 192destination.Write(_memory.Span.Slice(_position, _length - _position)); 229_memory.Span.Slice(_length, _position - _length).Clear(); 265_memory.Span.Slice(_length, _position - _length).Clear(); 329_memory.Span.Slice(_length, newLength - _length).Clear();
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (10)
4788destination = destination.Slice(0, source.Length); 4801destination = destination.Slice(0, source.Length); 4840ReplaceAny(destination.Slice(0, source.Length), values, newValue); 4890ReplaceAnyExcept(destination.Slice(0, source.Length), values, newValue); 5333Span<Range> destinationMinusOne = destination.Slice(0, destination.Length - 1); 6332_destination.Slice(_pos, paddingRequired).Fill(' '); 6337_destination.Slice(_pos, paddingRequired).Fill(' '); 6450_destination.Slice(_pos, paddingNeeded).Fill(' '); 6454_destination.Slice(startingPos, charsWritten).CopyTo(_destination.Slice(startingPos + paddingNeeded)); 6455_destination.Slice(startingPos, paddingNeeded).Fill(' ');
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Number.BigInteger.cs (3)
808Span<nuint> resultBlocks = ((Span<nuint>)result._blocks).Slice(0, maxResultLength); 1201((Span<nuint>)_blocks).Slice(0, length).CopyTo(((Span<nuint>)_blocks).Slice(blocksToShift)); 1351private void Clear(int length) => ((Span<nuint>)_blocks).Slice(0, length).Clear();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.cs (4)
799|| number.Digits.Slice(index, number.DigitsCount - index).ContainsAnyExcept((byte)'0')) 3671scratch.Slice(index, count).CopyTo(digits); 3834digits.Slice(number.DigitsCount, end - number.DigitsCount).Fill((byte)'0'); 3867digits.Slice(number.DigitsCount, preferredZeros).Fill((byte)'0');
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.DiyFp128Cbrt.cs (2)
82DiyFp128AddSub(cube, term, UxAdd, sums.Slice(0, 1)); 84DiyFp128AddSub(cube, term, UxAdd, sums.Slice(1, 1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (16)
418ReadOnlySpan<byte> dig = number.Digits.Slice(0, digitCount); 1797WriteTwoDigits(value, buffer.Slice(0, 2)); 1873Int32ToHexChars(destination.Slice(0, bufferLength), (uint)value, hexBase); 1921UInt32ToBinaryChars(destination.Slice(0, bufferLength), value); 1962WriteTwoDigits(value, destination.Slice(0, 2)); 1963WriteTwoDigits(remainder, destination.Slice(2, 2)); 2163Int64ToHexChars(destination.Slice(0, bufferLength), (ulong)value, hexBase); 2227UInt64ToBinaryChars(destination.Slice(0, bufferLength), value); 2317WriteTwoDigits((uint)value, buffer.Slice(0, 2)); 2477digits.Slice(start, i).CopyTo(digits); 2571Int128ToHexChars(destination.Slice(0, bufferLength), uValue, hexBase); 2582Int64ToHexChars(buffer.Slice(0, upperLength), value.Upper, hexBase); 2626UInt128ToBinaryChars(destination.Slice(0, bufferLength), uValue); 2637UInt64ToBinaryChars(buffer.Slice(0, upperLength), value.Upper); 2661digits.Slice(start, i).CopyTo(digits); 2692buffer = buffer.Slice(0, index);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.NumberToFloatingPointBits.cs (2)
704ReadOnlySpan<byte> digits = number.Digits.Slice((int)firstIndex, (int)(lastIndex - firstIndex)); 968ulong mantissa = DigitsToUInt64(number.Digits.Slice(0, (int)(totalDigits)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (1)
847ReadOnlySpan<byte> digits = number.Digits.Slice(0, number.DigitsCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Rounding.cs (1)
417buffer.Slice(0, digitCount).Reverse();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (1)
1776return Number.DigitsToUInt64(number.Digits.Slice(0, digits));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (1)
1755return Number.DigitsToUInt32(number.Digits.Slice(0, digits));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (1)
1748return Number.DigitsToUInt64(number.Digits.Slice(0, digits));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\INumberBase.cs (5)
335utf16Text = utf16Text.Slice(0, utf16TextLength); 518utf16Text = utf16Text.Slice(0, utf16TextLength); 588utf16Destination = utf16Destination.Slice(0, charsWritten); 643utf16Text = utf16Text.Slice(0, utf16TextLength); 691utf16Text = utf16Text.Slice(0, utf16TextLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (5)
216bytes = bytes.Slice(0, byteCount); 352bytes = bytes.Slice(0, byteCount); 391bytes = bytes.Slice(0, byteCount); 516randomBytes = randomBytes.Slice(0, destination.Length); 544randomBytes = randomBytes.Slice(0, destination.Length * 2);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Range.cs (1)
93return new string(span.Slice(0, pos));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (1)
347foreach (byte b in utf8Bytes.Slice(0, bytesWritten))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (3)
1700callstackSpanIndex += Serializer.WriteCompressedUInt64(callstackSpan.Slice(callstackSpanIndex, Serializer.MaxCompressedUInt64Size), currentMethodId); 1704callstackSpanIndex += Serializer.WriteCompressedInt64(callstackSpan.Slice(callstackSpanIndex, Serializer.MaxCompressedInt64Size), (long)(currentMethodId - previousMethodId)); 1707callstackSpanIndex += Serializer.WriteCompressedInt32(callstackSpan.Slice(callstackSpanIndex, Serializer.MaxCompressedInt32Size), frameState);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (7)
141public ReadOnlySpan<char> Text => _chars.Slice(0, _pos); 445_chars.Slice(_pos, paddingRequired).Fill(' '); 450_chars.Slice(_pos, paddingRequired).Fill(' '); 579_chars.Slice(_pos, paddingNeeded).Fill(' '); 583_chars.Slice(startingPos, charsWritten).CopyTo(_chars.Slice(startingPos + paddingNeeded)); 584_chars.Slice(startingPos, paddingNeeded).Fill(' '); 656_chars.Slice(0, _pos).CopyTo(newArray);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (1)
122components = components.Slice(0, numComponents);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\BitVector256.cs (2)
63return chars.Slice(0, size).ToArray(); 78return bytes.Slice(0, size).ToArray();
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.cs (1)
257seenValues = seenValues.Slice(0, (int)range);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
172Span<char> upperCase = stackalloc char[MaxInputLength].Slice(0, span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (1)
83Span<int> bucketIndexes = stackalloc int[RabinKarp.MaxValues].Slice(0, values.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
100return values.Slice(0, newCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (4)
195span.Slice(index, _decryptedLength - index).CopyTo(span.Slice(index + 1)); 240span.Slice(index + 1, _decryptedLength - (index + 1)).CopyTo(span.Slice(index)); 324span.Slice(0, length).CopyTo(new Span<char>((void*)ptr, length)); 358Span<char> span = AcquireSpan(ref bufferToRelease).Slice(0, _decryptedLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (4)
235combinedBuffer = combinedBuffer.Slice(0, ConcatInto(GetLeftoverData(), bytes, combinedBuffer)); 266if (FallbackBuffer.Fallback(combinedBuffer.Slice(0, combinedBufferBytesConsumed).ToArray(), index: -_leftoverByteCount)) 291combinedBuffer = combinedBuffer.Slice(0, ConcatInto(GetLeftoverData(), bytes, combinedBuffer)); 334if (FallbackBuffer.Fallback(combinedBuffer.Slice(0, combinedBufferBytesConsumed).ToArray(), index: -_leftoverByteCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (3)
236original = original.Slice(0, charCount); 237modified = modified.Slice(0, charCount); 303return buffer.Slice(0, charsWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (1)
1475return Insert(index, buffer.Slice(0, charsWritten), 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (5)
688AppendFormatted(utf16.Slice(0, charsWritten)) : 735AppendFormatted(utf16.Slice(0, charsWritten)) : 797_destination.Slice(_pos, paddingNeeded).Fill((byte)' '); 801_destination.Slice(startingPos, bytesWritten).CopyTo(_destination.Slice(startingPos + paddingNeeded)); 802_destination.Slice(startingPos, paddingNeeded).Fill((byte)' ');
src\runtime\src\libraries\System.Private.CoreLib\src\System\Version.cs (1)
177return dest.Slice(0, charsWritten).ToString();
System\Reflection\ConstructorInvoker.cs (3)
72object result = _methodBaseInvoker.CreateInstanceWithFewArgs(((Span<object?>)argStorage._args).Slice(0, 2)); 89object result = _methodBaseInvoker.CreateInstanceWithFewArgs(((Span<object?>)argStorage._args).Slice(0, 3)); 107object result = _methodBaseInvoker.CreateInstanceWithFewArgs(((Span<object?>)argStorage._args).Slice(0, 4));
System\Reflection\DynamicInvokeInfo.cs (5)
496Span<object?> copyOfParameters = ((Span<object?>)argStorage._args).Slice(0, _argumentCount); 500Span<bool> shouldCopyBack = ((Span<bool>)copyBackStorage).Slice(0, _argumentCount); 528Span<object?> copyOfParameters = ((Span<object?>)argStorage._args).Slice(0, _argumentCount); 532Span<bool> shouldCopyBack = ((Span<bool>)copyBackStorage).Slice(0, _argumentCount); 693Span<bool> shouldCopyBack = ((Span<bool>)copyBackStorage).Slice(0, parameters.Length);
System\Reflection\MethodInvoker.cs (3)
87object? result = _methodBaseInvoker.InvokeDirectWithFewArgs(obj, ((Span<object?>)argStorage._args).Slice(0, 2)); 105object? result = _methodBaseInvoker.InvokeDirectWithFewArgs(obj, ((Span<object?>)argStorage._args).Slice(0, 3)); 124object? result = _methodBaseInvoker.InvokeDirectWithFewArgs(obj, ((Span<object?>)argStorage._args).Slice(0, 4));
System.Private.CoreLib.Generators (5)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
System.Private.DataContractSerialization (2)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (2)
511SupportedEncoding e = DetectEncoding(leading.Slice(0, read), out int bomLength); 515leading.Slice(bomLength, preserve).CopyTo(_bytes);
System.Private.Uri (25)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\DomainNameHelper.cs (1)
257AppendIdnUnicode(asciiBuffer.Slice(0, asciiWritten), ref dest);
System\IPv4AddressHelper.cs (1)
42return new string(stackSpace.Slice(0, totalChars + charsWritten));
System\IPv6AddressHelper.cs (1)
87return new string(stackSpace.Slice(0, pos));
System\IriHelper.cs (1)
159ReadOnlySpan<byte> encodedBytes = maxUtf8EncodedSpan.Slice(0, bytesWritten);
System\Uri.cs (3)
1073Span<char> slashSpan = result.RawChars.Slice(0, result.Length); 4354Span<char> chars = vsb.RawChars.Slice(0, vsb.Length); 4384dest.RawChars.Slice(start, dest.Length - start),
System\UriHelper.cs (3)
33string result = string.Concat(start, vsb.RawChars.Slice(0, charsWritten)); 276foreach (byte b in utf8Bytes.Slice(0, bytesWritten)) 755span.Slice(readOffset, segmentLength).CopyTo(span.Slice(writeOffset));
System.Private.Windows.Core (23)
_generated\12\Windows.Win32.byte.InlineArrays.g.cs (1)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\166\Windows.Win32.ITypeLib.g.cs (2)
365 szNameBuf = szNameBuf.Slice(0, wstrszNameBuf.Length); 420 szNameBuf = szNameBuf.Slice(0, wstrszNameBuf.Length);
_generated\215\Windows.Win32.RECT.InlineArrays.g.cs (1)
54 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\254\Windows.Win32.System_Com_ITypeLib_Extensions.g.cs (2)
92 szNameBuf = szNameBuf.Slice(0, wstrszNameBuf.Length); 110 szNameBuf = szNameBuf.Slice(0, wstrszNameBuf.Length);
_generated\37\Windows.Win32.char.InlineArrays.g.cs (2)
79 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 143 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
System\BufferScope.cs (2)
105public readonly Span<T> this[Range range] => _span[range]; 107public readonly Span<T> Slice(int start, int length) => _span.Slice(start, length);
System\SpanWriter.cs (2)
17set => _unwritten = Span[value..]; 77public void Advance(int count) => _unwritten = _unwritten[count..];
System\Text\ValueStringBuilder.cs (11)
134public readonly ReadOnlySpan<char> AsSpan(int start) => _chars[start.._pos]; 135public readonly ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 161_chars.Slice(index, remaining).CopyTo(_chars[(index + count)..]); 162_chars.Slice(index, count).Fill(value); 181_chars.Slice(index, remaining).CopyTo(_chars[(index + count)..]); 182s.CopyTo(_chars[index..]); 236s.CopyTo(_chars[pos..]); 245while (!((ISpanFormattable)value).TryFormat(_chars[_pos..], out charsWritten, format: default, provider: default)) 265Span<char> dst = _chars.Slice(_pos, count); 282Span<char> dst = _chars.Slice(_pos, length); 299value.CopyTo(_chars[_pos..]);
System.Private.Windows.GdiPlus (1)
_generated\25\Windows.Win32.float.InlineArrays.g.cs (1)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
System.Private.Xml (14)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\Xml\Cache\XPathDocumentNavigator.cs (1)
925return buf.Slice(0, idx).ToString();
System\Xml\Schema\XsdDateTime.cs (1)
533return 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 (12)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
252parts = parts.Slice(0, attributeValueSpan.Split(parts, '.'));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (1)
262return GetOrAddBlob(buffer.Slice(0, length));
System.Runtime.Numerics (167)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (3)
257WriteTwoDigits(value, buffer.Slice(index, 2)); 1021Span<TChar> groupBuffer = buffer.Slice(groupStartWrite, digitsInGroup); 1041sGroup.CopyTo(buffer.Slice(writePos, sGroup.Length));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder_1.cs (12)
102Span<TChar> slice = _chars.Slice(0, _pos); 136return _chars.Slice(0, _pos); 139public readonly ReadOnlySpan<TChar> AsSpan() => _chars.Slice(0, _pos); 140public readonly ReadOnlySpan<TChar> AsSpan(int start) => _chars.Slice(start, _pos - start); 141public readonly ReadOnlySpan<TChar> AsSpan(int start, int length) => _chars.Slice(start, length); 145if (_chars.Slice(0, _pos).TryCopyTo(destination)) 167_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 168_chars.Slice(index, count).Fill(value); 187_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 247Span<TChar> dst = _chars.Slice(_pos, count); 265return _chars.Slice(origPos, length); 301_chars.Slice(0, _pos).CopyTo(poolArray);
System\Number.BigInteger.cs (24)
394ReadOnlySpan<byte> intDigits= number.Digits.Slice(0, Math.Min(number.Scale, number.DigitsCount)); 480leading = leading.Slice(0, BigIntegerCalculator.ActualLength(leading)); 521ReadOnlySpan<nuint> buffer2 = buffer.Slice(0, BigIntegerCalculator.ActualLength(buffer)); 522Span<nuint> bitsUpper = bits.Slice(multiplierTrailingZeroCount, buffer2.Length + multiplier.Length); 529BigIntegerCalculator.AddSelf(bits, buffer.Slice(0, BigIntegerCalculator.ActualLength(buffer))); 547nuint carry = MultiplyAdd(bits.Slice(0, resultLength), PowersOf1e9.TenPowMaxPartial, 0); 558nuint carry = MultiplyAdd(bits.Slice(0, resultLength), multiplier, 0); 578nuint carry = MultiplyAdd(bits.Slice(0, resultLength), PowersOf1e9.TenPowMaxPartial, base1E9[i]); 631bits = bits.Slice(0, bytesWrittenOrNeeded); 715bytes = bytes.Slice(0, bytesWrittenOrNeeded); 898BigIntegerToDecChars(destination.Slice(sNegative.Length, strDigits), base1E9Value, digits); 934scoped NumberBuffer number = new NumberBuffer(NumberBufferKind.Integer, numberBuffer.Slice(0, valueDigits + 1)); 935BigIntegerToDecChars(Unsafe.BitCast<Span<byte>, Span<Utf8Char>>(number.Digits.Slice(0, valueDigits)), base1E9Value, valueDigits); 1092lower.Slice(0, BigIntegerCalculator.ActualLength(lower)), 1103upper.Slice(0, BigIntegerCalculator.ActualLength(upper)), 1383LeadingPowers1E9.CopyTo(pow1E9.Slice(0, LeadingPowers1E9.Length)); 1386ReadOnlySpan<nuint> src = pow1E9.Slice(Indexes[5], Indexes[6] - Indexes[5]); 1396Span<nuint> dst = pow1E9.Slice(toExclusive, src.Length << 1); 1412src = pow1E9.Slice(from, toExclusive - from); 1480BigIntegerCalculator.Multiply(left, UInt32PowersOfTen[trailingZeroCount], bits.Slice(0, left.Length + 1)); 1515Span<nuint> src = powersOfTen.Slice(0, curLength); 1516Span<nuint> dst = powersOfTen2.Slice(0, curLength += power.Length); 1531powersOfTen = powersOfTen.Slice(0, curLength); 1532Span<nuint> bits2 = bits.Slice(omittedLength, curLength += left.Length);
System\Numerics\BigInteger.cs (7)
1669Span<byte> destBytes = destination.Slice(curByte, srcBytes.Length); 1758buffer = buffer.Slice(0, _bits.Length + 1); 1761NumericsHelpers.DangerousMakeTwosComplement(buffer.Slice(0, buffer.Length - 1)); // Mutates limbs 1781buffer = buffer.Slice(0, count); 2910zd.Slice(0, leastSignificant).Clear(); 3624Span<uint> words = MemoryMarshal.Cast<nuint, uint>(zd).Slice(0, zWordCount); 3649Span<uint> words = MemoryMarshal.Cast<nuint, uint>(zd).Slice(0, zWordCount);
System\Numerics\BigIntegerCalculator.DivRem.cs (16)
220bits.Slice(0, sigmaDigit).Clear(); 263q.Slice(0, quotientUpper.Length).CopyTo(quotientUpper); 269BurnikelZieglerD2n1n(z, b, quotientUpper.Slice(0, n), r); 275a.Slice(i * n, n).CopyTo(z); 276r.Slice(0, n).CopyTo(z.Slice(n)); 277BurnikelZieglerD2n1n(z, b, quotient.Slice(i * n, n), r); 287Debug.Assert(!r.Slice(0, sigmaDigit).ContainsAnyExcept(0u)); 371DivideGrammarSchool(r1, right, quotient.Slice(0, quotientLength)); 381r1.Slice(0, remainder.Length).CopyTo(remainder); 408BurnikelZieglerD3n2n(r1.Slice(0, right.Length), left.Slice(0, halfN), right, quotient.Slice(0, halfN), remainder); 447d.Slice(0, n).Clear(); 453left3.CopyTo(remainder.Slice(0, n)); 455Span<nuint> rr = remainder.Slice(0, d.Length + 1); 464quotient.Slice(0, qi).Fill(nuint.MaxValue); 477bits = bits.Slice(0, left.Length + right.Length);
System\Numerics\BigIntegerCalculator.FastReducer.cs (7)
42_mu = mu.Slice(0, ActualLength(mu)); 61int l2 = DivMul(_q1.Slice(0, l1), _modulus, _q2, _modulus.Length + 1); 64int length = SubMod(value, _q2.Slice(0, l2), _modulus, _modulus.Length + 1); 85bits = bits.Slice(0, left.Length + right.Length); 104left = left.Slice(0, k); 141left = left.Slice(0, ActualLength(left)); 146left = left.Slice(0, ActualLength(left));
System\Numerics\BigIntegerCalculator.GcdInv.cs (5)
196left = left.Slice(0, Reduce(left, right)); 206left = left.Slice(0, Refresh(left, count)); 207right = right.Slice(0, Refresh(right, count)); 243left = left.Slice(0, Overwrite(left, Gcd(x, y))); 463return ActualLength(bits.Slice(0, maxLength));
System\Numerics\BigIntegerCalculator.PowMod.cs (45)
53resultLength = MultiplySelf(ref result, resultLength, value.Slice(0, valueLength), ref temp); 64return result.Slice(0, resultLength); 73Multiply(left.Slice(0, leftLength), right, temp.Slice(0, resultLength)); 81return ActualLength(left.Slice(0, resultLength)); 91Square(value.Slice(0, valueLength), temp.Slice(0, resultLength)); 99return ActualLength(value.Slice(0, resultLength)); 276Remainder(value, modulus, valueCopy.Slice(0, value.Length)); 316Remainder(value, modulus, valueCopy.Slice(0, value.Length)); 497value.Slice(0, valueLength).CopyTo(shifted.Slice(k)); 504shifted.Slice(0, k).CopyTo(value); 506valueLength = ActualLength(value.Slice(0, k)); 517oneShifted.Slice(0, k).CopyTo(rModN); 529rModN.Slice(0, rModNLength).CopyTo(bits); 532bits.Slice(0, resultLength).CopyTo(originalBits); 557value.Slice(0, valueLength).CopyTo(table.Slice(0, k)); 568Square(value.Slice(0, valueLength), prod.Slice(0, valueLength * 2)); 570prod.Slice(0, k).CopyTo(base2); 576ReadOnlySpan<nuint> prev = table.Slice((i - 1) * k, k); 580Multiply(prev.Slice(0, prevLength), base2.Slice(0, base2Length), 581prod.Slice(0, prevLength + base2Length)); 583prod.Slice(0, k).CopyTo(table.Slice(i * k, k)); 592rModN.Slice(0, rModNLength).CopyTo(bits); 632ReadOnlySpan<nuint> entry = table.Slice(((wValue - 1) >> 1) * k, k); 648bits.Slice(0, resultLen).CopyTo(originalBits); 718Span<nuint> upper = value.Slice(k, k); 736return ActualLength(value.Slice(0, k)); 757resultLength = MultiplySelf(ref result, resultLength, value.Slice(0, valueLength), ref temp); 758resultLength = Reduce(result.Slice(0, resultLength), modulus); 762valueLength = Reduce(value.Slice(0, valueLength), modulus); 785resultLength = MultiplySelf(ref result, resultLength, value.Slice(0, valueLength), ref temp); 786resultLength = Reduce(result.Slice(0, resultLength), modulus); 792valueLength = Reduce(value.Slice(0, valueLength), modulus); 798return result.Slice(0, resultLength); 819resultLength = MultiplySelf(ref result, resultLength, value.Slice(0, valueLength), ref temp); 820resultLength = reducer.Reduce(result.Slice(0, resultLength)); 824valueLength = reducer.Reduce(value.Slice(0, valueLength)); 847resultLength = MultiplySelf(ref result, resultLength, value.Slice(0, valueLength), ref temp); 848resultLength = reducer.Reduce(result.Slice(0, resultLength)); 854valueLength = reducer.Reduce(value.Slice(0, valueLength)); 860return result.Slice(0, resultLength);
System\Numerics\BigIntegerCalculator.ShiftRot.cs (3)
78Span<nuint> lower = bits.Slice(0, lowerLength); 113Span<uint> lower = bits.Slice(0, lowerLength); 122Span<uint> tmp = MemoryMarshal.Cast<nuint, uint>(tmpNuint).Slice(0, tmpLength);
System\Numerics\BigIntegerCalculator.SquMul.cs (39)
77Toom3Data p = Toom3Data.Build(value, n, pAndQAll.Slice(0, 3 * pLength)); 113Span<nuint> bitsLow = bits.Slice(0, n2); 286Toom3Data p = Toom3Data.Build(left, n, pAndQAll.Slice(0, 3 * pLength)); 319Span<nuint> z0 = bits.Slice(0, left0.Length + right0.Length); 333Span<nuint> p1 = pAndQAll.Slice(0, pLength); 334Span<nuint> pm1 = pAndQAll.Slice(pLength, pLength); 335Span<nuint> q1 = pAndQAll.Slice(pLength * 2, pLength); 336Span<nuint> qm1 = pAndQAll.Slice(pLength * 3, pLength); 369Span<nuint> z1 = cAll.Slice(0, cLength); 370Span<nuint> c1 = z1.Slice(0, p1.Length + q1.Length); 372Span<nuint> z2 = cAll.Slice(cLength, cLength); 373Span<nuint> cm1 = cAll.Slice(cLength * 2, pm1.Length + qm1.Length); 438Span<nuint> bitsLow = bits.Slice(0, n + n); 497Span<nuint> bitsLow = bits.Slice(0, n + right.Length); 506Span<nuint> carryOrig = bitsHigh.Slice(0, right.Length); 511Multiply(leftHigh, right, bitsHigh.Slice(0, leftHigh.Length + right.Length)); 560Span<nuint> p1 = buffer.Slice(0, pLength); 561Span<nuint> pm1 = buffer.Slice(pLength, pLength); 579Span<nuint> pm2 = buffer.Slice(pLength + pLength, pLength); 639Span<nuint> r0 = bits.Slice(0, p0.Length + q0.Length); 642? bits.Slice(4 * n, pInf.Length + qInf.Length) 645Span<nuint> r1 = buffer.Slice(0, p1.Length + q1.Length); 646Span<nuint> rm1 = buffer.Slice(rLength, pm1.Length + qm1.Length); 647Span<nuint> rm2 = buffer.Slice(rLength * 2, pm2.Length + qm2.Length); 659z1: buffer.Slice(0, rLength), 661z2: buffer.Slice(rLength, rLength), 664z3: buffer.Slice(rLength * 2, rLength), 683Span<nuint> r0 = bits.Slice(0, p0.Length << 1); 684Span<nuint> rInf = bits.Slice(4 * n, pInf.Length << 1); 686Span<nuint> r1 = buffer.Slice(0, p1.Length << 1); 687Span<nuint> rm1 = buffer.Slice(rLength, pm1.Length << 1); 688Span<nuint> rm2 = buffer.Slice(rLength * 2, pm2.Length << 1); 700z1: buffer.Slice(0, rLength), 702z2: buffer.Slice(rLength, rLength), 705z3: buffer.Slice(rLength * 2, rLength), 729SubtractSelf(z3, ref z3Sign, z1.Slice(0, r1Length)); 737AddSelf(z1, ref z1Sign, z2.Slice(0, rm1Length), -z2Sign); 970left = left.Slice(0, right.Length); 1014left = left.Slice(0, right.Length);
System\Numerics\BigIntegerCalculator.Utils.cs (1)
18return ActualLength(bits.Slice(0, modulus.Length));
System.Security.Cryptography (149)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
50return GetAndTrimString(stackBuffer.Slice(0, length));
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.NCryptDeriveKeyMaterial.cs (2)
115parameters.Slice(0, parameterCount), 313destination.Slice(0, localWritten).Reverse();
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (3)
75CopySignatureField(rDer, destination.Slice(0, fieldSizeBytes)); 76CopySignatureField(sDer, destination.Slice(fieldSizeBytes, fieldSizeBytes)); 104response.Slice(0, writeOffset).Clear();
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (1)
330destination.Slice(0, numBytesNeeded).CopyTo(trimmed);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (5)
171return lease.Span.Slice(0, bytesWritten).ToArray(); 223int bytesWritten = SignDataCore(data, context, destination.Slice(0, Algorithm.MaxSignatureSizeInBytes)); 1611lease.Span.Slice(0, localBytesWritten).CopyTo(destination); 1741lease.Span.Slice(0, localBytesWritten).CopyTo(destination); 1838writer.WriteOctetString(lease.Span.Slice(0, privateKeySize));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLKem.cs (4)
1880lease.Span.Slice(0, localBytesWritten).CopyTo(destination); 2030lease.Span.Slice(0, localBytesWritten).CopyTo(destination); 2107writer.WriteOctetString(lease.Span.Slice(0, decapsulationKeySize)); 2228return func(lease.Span.Slice(0, written));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (2)
69Span<byte> toClear = Span.Slice(0, clearSize); 122Span = currentBuffer.Slice(0, length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.SignVerify.cs (3)
68destination.Slice(0, bytesWritten), 139stackBuf.Slice(0, zeroByteCount).Clear(); 141return stackBuf.Slice(0, qLength);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDsaCng.SignVerify.cs (1)
70destination.Slice(0, bytesWritten),
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (1)
55destination.Slice(0, destination.Length - span.Length).Clear();
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (10)
220buf = buf.Slice(0, byteCount); 230buf = buf.Slice(0, written); 505buf = buf.Slice(0, byteCount); 515buf = buf.Slice(0, written); 700iv = iv.Slice(0, rc2Parameters.Iv.Length); 752iv = iv.Slice(0, bytesWritten); 884Span<byte> k = dk.Slice(0, 8); 885Span<byte> iv = dk.Slice(8, 8); 1041t = t.Slice(0, tLength); 1056t.Slice(0, dk.Length).CopyTo(dk);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (4)
162CircularCopy(salt, I.Slice(0, SLen)); 202hashBuf.Slice(0, destination.Length).CopyTo(destination); 218Span<byte> I_j = I.Slice(j * vBytes, vBytes); 288Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PqcBlobHelpers.cs (3)
204blobBytes = blobBytes.Slice(0, blobSize); 341return callback(state, blobKind, buffer.Slice(0, blobSize)); 345CryptographicOperations.ZeroMemory(buffer.Slice(0, blobSize));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (12)
135Span<byte> ps = destination.Slice(2, destination.Length - source.Length - 3); 282destination.Slice(2, paddingLength).Fill(0xFF); 316Span<byte> seed = destination.Slice(1, hLen); 324Span<byte> lHash = db.Slice(0, hLen); 326Span<byte> ps = db.Slice(hLen, db.Length - hLen - 1 - mDest.Length); 327Span<byte> psEnd = db.Slice(hLen + ps.Length, 1); 410destination.Slice(0, destination.Length - emLen).Clear(); 413Span<byte> em = destination.Slice(destination.Length - emLen, emLen); 417Span<byte> db = em.Slice(0, dbLen); 418Span<byte> hDest = em.Slice(dbLen, hLen); 448db.Slice(0, psLen).Clear(); 624tmp.Slice(0, writePtr.Length).CopyTo(writePtr);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Utf8DataEncoding.cs (1)
23_buffer = _buffer.Slice(0, written);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519DiffieHellman.cs (2)
1459writer(state, destination.Slice(spkiPreamble.Length, PublicKeySizeInBytes)); 1537Span<byte> privateKeyBuffer = destination.Slice(pkcs8Preamble.Length, PrivateKeySizeInBytes);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519DiffieHellmanCng.Windows.cs (1)
214X25519WindowsHelpers.ExportKey(lease.Span.Slice(0, numBytesNeeded), privateKey, destination);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519WindowsHelpers.cs (2)
105Span<byte> destination = lease.Span.Slice(blobHeaderSize + ElementSize * 2, ElementSize); 114Span<byte> destination = lease.Span.Slice(blobHeaderSize, ElementSize);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (2)
634ReadOnlySpan<byte> lengthPart = earlyBuf.Slice(1, read - 1); 651earlyBuf.Slice(0, read).CopyTo(rented);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\Security\Cryptography\Aes.cs (11)
264destination = destination.Slice(0, requiredLength); 515return lease.Span.Slice(0, written).ToArray(); 598destination = destination.Slice(0, maxOutput); 630lease.Span.Slice(0, written).CopyTo(destination); 824Span<byte> A = B.Slice(0, 8); 825Span<byte> ALo = A.Slice(4, 4); 837R.Slice(0, 8).CopyTo(B.Slice(8)); 845B.Slice(8, 8).CopyTo(R); 859Span<byte> A = B.Slice(0, 8); 860Span<byte> ALo = A.Slice(4, 4); 877R.Slice(0, 8).CopyTo(B.Slice(8));
System\Security\Cryptography\Base64Transforms.cs (2)
267return transformBuffer.Slice(0, index + inputBuffer.Length); 304transformBuffer = transformBuffer.Slice(0, bytesToTransform);
System\Security\Cryptography\CngKey.EC.cs (2)
95return nameLower.Slice(0, written) switch 121return nameLower.Slice(0, written) switch
System\Security\Cryptography\ConcurrentSafeKmac.cs (2)
80hashBuffer = hashBuffer.Slice(0, hash.Length); 109hashBuffer = hashBuffer.Slice(0, hash.Length);
System\Security\Cryptography\CryptographicOperations.cs (2)
853Span<byte> mac = macBuffer.Slice(0, written); 945Span<byte> mac = macBuffer.Slice(0, written);
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\EccKeyFormatHelper.cs (2)
763writer.WriteOctetString(basePointBytes.Slice(0, basePointLength)); 791writer.WriteBitString(publicKeyBytes.Slice(0, publicKeyLength));
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\Helpers.cs (1)
591return callback(key, message.Slice(0, messageLength), signatureBuffer);
System\Security\Cryptography\HKDF.cs (1)
62prk = prk.Slice(0, hashLength);
System\Security\Cryptography\HKDFManagedImplementation.cs (3)
40tempInfoBuffer = tempInfoBuffer.Slice(0, info.Length); 60t = remainingOutput.Slice(0, hashLength); 71lastChunk.Slice(0, remainingOutput.Length).CopyTo(remainingOutput);
System\Security\Cryptography\IncrementalHash.cs (1)
495Span<byte> computed = computedBuffer.Slice(0, written);
System\Security\Cryptography\KmacStatic.cs (1)
176hashBuffer = hashBuffer.Slice(0, hash.Length);
System\Security\Cryptography\Pbkdf2Implementation.Windows.cs (1)
81clearSpan = hashBuffer.Slice(0, hashBufferSize);
System\Security\Cryptography\PemEncoding.cs (1)
239return destination.Slice(0, size);
System\Security\Cryptography\RandomNumberGenerator.cs (4)
319Span<byte> remainingRandom = randomBuffer.Slice(0, Math.Min(RandomBufferSize, needed)); 339remainingRandom = randomBuffer.Slice(0, Math.Min(RandomBufferSize, needed)); 375randomBytes = randomBytes.Slice(0, destination.Length); 403randomBytes = randomBytes.Slice(0, destination.Length * 2);
System\Security\Cryptography\RandomNumberGeneratorImplementation.cs (1)
89remainder.Slice(0, next0Byte).CopyTo(data.Slice(first0Byte));
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
297uiSpan = uiSpan.Slice(0, _blockSize);
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (1)
285Span<byte> passwordBytes = passwordBuffer.Slice(0, passwordBytesWritten);
System\Security\Cryptography\RSA.cs (1)
417TrySignHash(destination.Slice(0, hashLength), destination, hashAlgorithm, padding, out bytesWritten))
System\Security\Cryptography\SP800108HmacCounterKdfImplementationCng.cs (1)
23clearSpan = buffer.Slice(0, symmetricKeyMaterialLength);
System\Security\Cryptography\SymmetricAlgorithm.cs (2)
784byte[] plaintext = decryptBuffer.Slice(0, written).ToArray(); 785CryptographicOperations.ZeroMemory(decryptBuffer.Slice(0, written));
System\Security\Cryptography\SymmetricPadding.cs (4)
69destination.Slice(count, padBytes - 1).Clear(); 86RandomNumberGenerator.Fill(destination.Slice(count, padBytes - 1)); 103destination.Slice(count, padBytes).Fill((byte)padBytes); 124destination.Slice(count, padBytes).Clear();
System\Security\Cryptography\UniversalCryptoDecryptor.cs (2)
112Span<byte> decryptedBytes = ciphertext.Slice(0, decryptWritten); 117decryptedBytes.Slice(0, unpaddedLength).CopyTo(outputBuffer);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (1)
38int transformWritten = BasicSymmetricCipher.TransformFinal(outputBuffer.Slice(0, padWritten), outputBuffer);
System\Security\Cryptography\UniversalCryptoOneShot.cs (11)
41Span<byte> transformBuffer = output.Slice(0, bytesTransformed); 88stackBuffer.Slice(0, stackTransformFinal), 91Span<byte> writtenDepadded = stackBuffer.Slice(0, depaddedLength); 139stackBuffer.Slice(0, finalTransformWritten), 142Span<byte> depaddedFinalTransform = stackBuffer.Slice(0, depaddedLength); 147CryptographicOperations.ZeroMemory(output.Slice(0, writtenToOutput)); 159CryptographicOperations.ZeroMemory(output.Slice(0, writtenToOutput)); 160CryptographicOperations.ZeroMemory(stackBuffer.Slice(0, finalTransformWritten)); 177decryptedBuffer = buffer.Slice(0, transformWritten); 191decryptedBuffer.Slice(0, unpaddedLength).CopyTo(output); 226Span<byte> paddedOutput = output.Slice(0, padWritten);
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.cs (1)
308return new string(buffer.Slice(0, ((int)cbData / 2) - 1));
System\Security\Cryptography\X509Certificates\FindPal.Windows.cs (1)
376return actual.Slice(0, cbData).SequenceEqual(keyIdentifier);
System\Security\Cryptography\X509Certificates\WindowsInterop.crypt32.cs (1)
41return new string(buffer.Slice(0, cchCount - 1));
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
468return Convert.ToHexString(buffer.Slice(0, written));
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (2)
1067Span<byte> pk1 = publicKeysBuffer.Slice(0, publicKey.Algorithm.PublicKeySizeInBytes); 1068Span<byte> pk2 = publicKeysBuffer.Slice(pk1.Length, publicKey.Algorithm.PublicKeySizeInBytes);
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (2)
750return FindByThumbprintCore(hashAlgorithm, thumbprint.Slice(0, bytesWritten)); 791if (thumbprintBuffer.Slice(0, bytesWritten).SequenceEqual(thumbprintBytes))
System\Security\Cryptography\X509Certificates\X509Pal.Windows.X500DistinguishedName.cs (2)
38return new string(buffer.Slice(0, cchDecoded - 1)); 101return new string(buffer.Slice(0, (cbFormat / 2) - 1));
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (1)
212return hash.Slice(0, TruncateSize).ToArray();
System\Security\Cryptography\XmlKeyHelper.cs (1)
152builder.Append(base64.Slice(0, written));
System.Security.Cryptography.Cose (9)
System\Security\Cryptography\Cose\CoseHelpers.cs (2)
202ReadOnlySpan<byte> encodedValue = buffer.Slice(0, bytesWritten); 231writer.WriteByteString(buffer.Slice(0, bytesWritten));
System\Security\Cryptography\Cose\CoseKey.cs (1)
205Span<byte> mldsaSignature = destination.Slice(0, _mldsaKey.Algorithm.SignatureSizeInBytes);
System\Security\Cryptography\Cose\CoseMessage.cs (1)
442toBeSignedBuilder.AppendToBeSigned(buffer.Slice(0, bytesWritten));
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (4)
383WriteCoseSignaturesArray(writer, signer, buffer.Slice(protectedMapBytesWritten), buffer.Slice(0, protectedMapBytesWritten), associatedData, content, contentStream); 455AppendToBeSigned(buffer, toBeSignedBuilder, SigStructureContext.Signature, bodyProtected, buffer.Slice(0, signProtectedBytesWritten), associatedData, content, contentStream); 784byte[] encodedSignProtected = bufferSpan.Slice(0, bytesWritten).ToArray(); 794byte[] signature = bufferSpan.Slice(0, bytesWritten).ToArray();
System\Security\Cryptography\Cose\CoseSign1Message.cs (1)
321AppendToBeSigned(buffer, toBeSignedBuilder, SigStructureContext.Signature1, buffer.Slice(0, protectedMapBytesWritten), ReadOnlySpan<byte>.Empty, associatedData, contentBytes, contentStream);
System.Security.Cryptography.Pkcs (29)
Internal\Cryptography\Pal\Windows\HelpersWindows.cs (2)
388int provType = BitConverter.ToInt32(stackSpan.Slice(0, size)); 402int keysetType = BitConverter.ToInt32(stackSpan.Slice(0, size));
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
50return GetAndTrimString(stackBuffer.Slice(0, length));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (2)
69Span<byte> toClear = Span.Slice(0, clearSize); 122Span = currentBuffer.Slice(0, length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (10)
220buf = buf.Slice(0, byteCount); 230buf = buf.Slice(0, written); 505buf = buf.Slice(0, byteCount); 515buf = buf.Slice(0, written); 700iv = iv.Slice(0, rc2Parameters.Iv.Length); 752iv = iv.Slice(0, bytesWritten); 884Span<byte> k = dk.Slice(0, 8); 885Span<byte> iv = dk.Slice(8, 8); 1041t = t.Slice(0, tLength); 1056t.Slice(0, dk.Length).CopyTo(dk);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (4)
162CircularCopy(salt, I.Slice(0, SLen)); 202hashBuf.Slice(0, destination.Length).CopyTo(destination); 218Span<byte> I_j = I.Slice(j * vBytes, vBytes); 288Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length));
System\Security\Cryptography\Pkcs\CmsHash.cs (2)
53_shake256.GetHashAndReset(destination.Slice(0, OutputSizeBytes)); 83_shake128.GetHashAndReset(destination.Slice(0, OutputSizeBytes));
System\Security\Cryptography\Pkcs\CmsSignature.cs (2)
203val.CopyTo(ieeeSignature.Slice(fieldSize - val.Length, val.Length)); 215val.CopyTo(ieeeSignature.Slice(fieldSize + fieldSize - val.Length, val.Length));
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (2)
185return VerifyHash(stackSpan.Slice(0, bytesWritten), hashAlgorithmId.Value); 522thumbprint = thumbprint.Slice(0, written);
System\Security\Cryptography\Pkcs\SignerInfo.cs (4)
678encoded = encoded.Slice(0, encodedLength); 715contentHash = contentHash.Slice(0, bytesWritten); 756attrHash = attrHash.Slice(0, bytesWritten); 813contentHash = contentHash.Slice(0, bytesWritten);
System.Security.Cryptography.ProtectedData (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
50return GetAndTrimString(stackBuffer.Slice(0, length));
System.Security.Principal.Windows (2)
System\Security\Principal\SID.cs (2)
474subAuthorities.Slice(0, subAuthoritiesLength) 732_sddlForm = result.Slice(0, length).ToString();
System.ServiceProcess.ServiceController (10)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System.Text.Encodings.Web (16)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_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)
54encodedCharCount = innerEncoder.EncodeUtf16(rune, tempBuffer.Slice(0, 6));
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (2)
87_allowedAsciiBytes = SearchValues.Create(allowedAsciiBytes.Slice(0, allowedAsciiCount)); 88_allowedAsciiChars = SearchValues.Create(allowedAsciiChars.Slice(0, allowedAsciiCount));
System\Text\Encodings\Web\TextEncoder.cs (1)
62utf16ScratchBuffer = utf16ScratchBuffer.Slice(0, charsWritten);
System.Text.Json (154)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
79? (stackalloc (TKey, int)[StackallocThreshold]).Slice(0, span.Length)
src\runtime\src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
164string result = destination.Slice(0, charsWritten).ToString(); 168destination.Slice(0, charsWritten).Clear(); 193destination.Slice(0, charsWritten).Clear();
System\Text\Json\Document\JsonDocument.cs (2)
326result = TextEquals(index, otherUtf8Text.Slice(0, written), isPropertyName, shouldUnescape: true); 331otherUtf8Text.Slice(0, written).Clear();
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (2)
34utf8Name = utf8Name.Slice(0, len); 195if (utf8Unescaped.Slice(0, written).SequenceEqual(propertyName.Slice(idx)))
System\Text\Json\JsonEncodedText.cs (1)
90utf8Bytes = utf8Bytes.Slice(0, actualByteCount);
System\Text\Json\JsonHelpers.Escaping.cs (2)
46byte[] escapedString = escapedValue.Slice(0, written).ToArray(); 74byte[] propertySection = GetPropertyNameSection(escapedValue.Slice(0, written));
System\Text\Json\Nodes\JsonArray.cs (1)
255path.Append(chars.Slice(0, charsWritten));
System\Text\Json\Reader\JsonReaderHelper.cs (3)
187sourceUnescaped = sourceUnescaped.Slice(0, written); 235sourceUnescaped = sourceUnescaped.Slice(0, written); 284utf8Unescaped = utf8Unescaped.Slice(0, written);
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (10)
25utf8Unescaped = utf8Unescaped.Slice(0, written); 55utf8Unescaped = utf8Unescaped.Slice(0, written); 82byte[] propertyName = utf8Unescaped.Slice(0, written).ToArray(); 107utf8Unescaped = utf8Unescaped.Slice(0, written); 140utf8Escaped = utf8Escaped.Slice(0, length); 145utf8Unescaped = utf8Unescaped.Slice(0, written); 182utf8Unescaped1 = utf8Unescaped1.Slice(0, written); 186utf8Unescaped2 = utf8Unescaped2.Slice(0, written); 214bytes = utf8Unescaped.Slice(0, bytesWritten).ToArray(); 242bytes = byteSpan.Slice(0, bytesWritten).ToArray();
System\Text\Json\Reader\Utf8JsonReader.cs (2)
562result = TextEqualsHelper(otherUtf8Text.Slice(0, written)); 567otherUtf8Text.Slice(0, written).Clear();
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (1)
630throw 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); 1304span = stackSpan.Slice(0, (int)sequenceLength); 1350span = stackSpan.Slice(0, (int)sequenceLength);
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (1)
54source = stackSpan.Slice(0, bytesWritten);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
249charBuffer = charBuffer.Slice(0, charsWritten);
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (5)
62byteBuffer = byteBuffer.Slice(0, written); 83writer.WriteRawValue(buffer.Slice(0, written)); 96writer.WritePropertyName(buffer.Slice(0, written)); 142writer.WriteRawValue(buffer.Slice(0, length)); 194return JsonReaderHelper.TryGetFloatingPointConstant(buffer.Slice(0, written), out value);
System\Text\Json\Serialization\Converters\Value\Ieee754FloatingPointConverter.cs (3)
151byteBuffer = byteBuffer.Slice(0, written); 231return TryGetFloatingPointConstant(buffer.Slice(0, written), out value); 277formatted = destination.Slice(0, written);
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (4)
57if (!Int128.TryParse(buffer.Slice(0, written), CultureInfo.InvariantCulture, out Int128 result)) 74writer.WriteRawValue(buffer.Slice(0, written)); 87writer.WritePropertyName(buffer.Slice(0, written)); 117writer.WriteRawValue(buffer.Slice(0, length));
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (3)
51source = stackSpan.Slice(0, bytesWritten); 86writer.WriteStringValue(output.Slice(0, bytesWritten)); 96writer.WritePropertyName(output.Slice(0, bytesWritten));
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (3)
51source = stackSpan.Slice(0, bytesWritten); 84writer.WriteStringValue(output.Slice(0, bytesWritten)); 94writer.WritePropertyName(output.Slice(0, bytesWritten));
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (4)
57if (!UInt128.TryParse(buffer.Slice(0, written), CultureInfo.InvariantCulture, out UInt128 result)) 74writer.WriteRawValue(buffer.Slice(0, written)); 87writer.WritePropertyName(buffer.Slice(0, written)); 117writer.WriteRawValue(buffer.Slice(0, length));
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (3)
46ReadOnlySpan<byte> utf8Source = utf8Buffer.Slice(0, bytesWritten); 111writer.WriteStringValue(span.Slice(0, charsWritten)); 130writer.WritePropertyName(span.Slice(0, charsWritten));
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
399utf8 = utf8.Slice(0, actualByteCount); 430utf8 = utf8.Slice(0, actualByteCount);
System\Text\Json\Serialization\JsonUnionTypeStructuralClassifier.cs (2)
397pocoCaseStates = pocoCaseStates.Slice(0, _pocoObjectCases.Length); 505propertyName = buffer.Slice(0, bytesWritten);
System\Text\Json\Serialization\ValueBitArray.cs (1)
67? stackBuffer.Slice(0, requiredUInt64Count)
System\Text\Json\Writer\JsonWriterHelper.cs (3)
35buffer.Slice(0, indent).Fill(indentByte); 317: stackalloc byte[JsonConstants.StackallocByteThreshold].Slice(0, quotedLength); 358return writeCallback(escapedValue.Slice(0, written + 2));
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\JsonWriterHelper.Escaping.cs (2)
201destination = destination.Slice(totalWritten, JsonConstants.MaxExpansionFactorWhileEscaping); 327destination = destination.Slice(totalWritten, JsonConstants.MaxExpansionFactorWhileEscaping);
System\Text\Json\Writer\Utf8JsonWriter.cs (2)
874WriteStartByOptions(escapedPropertyName.Slice(0, written), token); 1023WriteStartByOptions(escapedPropertyName.Slice(0, written), token);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (2)
149WriteBase64ByOptions(escapedPropertyName.Slice(0, written), bytes); 172WriteBase64ByOptions(escapedPropertyName.Slice(0, written), bytes);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (3)
156WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 179WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 383WritePropertyNameUnescaped(buffer.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (3)
155WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 178WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 382WritePropertyNameUnescaped(buffer.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (3)
155WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 178WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 371WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (3)
159WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 182WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 376WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (3)
159WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 182WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 375WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (2)
129WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 152WriteNumberByOptions(escapedPropertyName.Slice(0, written), value);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (3)
155WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 178WriteStringByOptions(escapedPropertyName.Slice(0, written), value); 387WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (3)
274WriteLiteralByOptions(escapedPropertyName.Slice(0, written), value); 297WriteLiteralByOptions(escapedPropertyName.Slice(0, written), value); 520WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (3)
228WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 251WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 449WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (14)
132propertyName = escapedPropertyName.Slice(0, written); 291utf8PropertyName = escapedPropertyName.Slice(0, written); 909WriteStringByOptions(escapedPropertyName, escapedValue.Slice(0, written)); 932WriteStringByOptions(escapedPropertyName, escapedValue.Slice(0, written)); 955WriteStringByOptions(escapedPropertyName.Slice(0, written), escapedValue); 978WriteStringByOptions(escapedPropertyName.Slice(0, written), escapedValue); 1086value = escapedValue.Slice(0, written); 1106propertyName = escapedPropertyName.Slice(0, written); 1146utf8Value = escapedValue.Slice(0, written); 1166utf8PropertyName = escapedPropertyName.Slice(0, written); 1206utf8Value = escapedValue.Slice(0, written); 1226propertyName = escapedPropertyName.Slice(0, written); 1266value = escapedValue.Slice(0, written); 1286utf8PropertyName = escapedPropertyName.Slice(0, written);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (3)
237WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 260WriteNumberByOptions(escapedPropertyName.Slice(0, written), value); 458WritePropertyNameUnescaped(utf8PropertyName.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (1)
102WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (1)
150WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (1)
150WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (1)
215utf8Json = utf8Json.Slice(0, actualByteCount);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (1)
115WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (2)
200WriteStringByOptions(escapedValue.Slice(0, written), requiredBytes); 347WriteStringByOptions(escapedValue.Slice(0, written));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (12)
72combinedBuffer = combinedBuffer.Slice(0, ConcatInto(partialStringDataBuffer, value, combinedBuffer)); 80value = combinedBuffer.Slice(0, charsConsumed); 88partialStringDataBuffer = combinedBuffer.Slice(0, charsConsumed); 94partialStringDataBuffer = combinedBuffer.Slice(0, charsConsumed); 148WriteStringSegmentData(escapedValue.Slice(0, written)); 240combinedBuffer = combinedBuffer.Slice(0, ConcatInto(partialStringDataBuffer, utf8Value, combinedBuffer)); 248utf8Value = combinedBuffer.Slice(0, bytesConsumed); 256partialStringDataBuffer = combinedBuffer.Slice(0, bytesConsumed); 262partialStringDataBuffer = combinedBuffer.Slice(0, bytesConsumed); 314WriteStringSegmentData(escapedValue.Slice(0, written)); 407combinedBuffer = combinedBuffer.Slice(0, ConcatInto(partialStringDataBuffer, bytes, combinedBuffer)); 412partialStringDataBuffer = combinedBuffer.Slice(0, 3);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (1)
117WriteNumberValueAsStringUnescaped(utf8Number.Slice(0, bytesWritten));
System.Text.Json.SourceGeneration (9)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
79? (stackalloc (TKey, int)[StackallocThreshold]).Slice(0, span.Length)
src\runtime\src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
164string result = destination.Slice(0, charsWritten).ToString(); 168destination.Slice(0, charsWritten).Clear(); 193destination.Slice(0, charsWritten).Clear();
System.Text.RegularExpressions (28)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\Text\RegularExpressions\RegexCharClass.cs (5)
821foreach (UnicodeCategory cat1 in categories1.Slice(0, numCategories1)) 823foreach (UnicodeCategory cat2 in categories2.Slice(0, numCategories2)) 924foreach (UnicodeCategory cat1 in categories1.Slice(0, numCategories1)) 927foreach (UnicodeCategory cat2 in categories2.Slice(0, numCategories2)) 1982Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
System\Text\RegularExpressions\RegexCompiler.cs (2)
1954foreach (char c in setChars.Slice(0, numChars)) 5541setChars = setChars.Slice(0, setCharsCount);
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
134chars = scratch.Slice(0, scratchCount).ToArray();
System\Text\RegularExpressions\RegexNode.cs (2)
1618foreach (char c in setChars.Slice(0, numChars)) 1695return 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(); 1236chars = chars.Slice(0, RegexCharClass.GetSetChars(nextChild.Str!, chars));
System.Text.RegularExpressions.Generator (30)
RegexGenerator.Emitter.cs (4)
685helperName = $"IndexOfAny{(negatedCategory ? "Except" : "")}{string.Concat(categories.Slice(0, numCategories).ToArray().Select(c => c.ToString()))}"; 1898writer.WriteLine($"case {string.Join(" or ", setChars.Slice(0, numChars).ToArray().Select(Literal))}:"); 5107setChars = setChars.Slice(0, RegexCharClass.GetSetChars(node.Str, setChars)); 5262foreach (UnicodeCategory category in categories.Slice(0, numCategories))
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (5)
101_span.Slice(0, _pos).CopyTo(_span.Slice(source.Length)); 116return span.Slice(pos, length); 130return _span.Slice(pos, length); 146return _span.Slice(0, _pos); 151if (_span.Slice(0, _pos).TryCopyTo(destination))
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (5)
821foreach (UnicodeCategory cat1 in categories1.Slice(0, numCategories1)) 823foreach (UnicodeCategory cat2 in categories2.Slice(0, numCategories2)) 924foreach (UnicodeCategory cat1 in categories1.Slice(0, numCategories1)) 927foreach (UnicodeCategory cat2 in categories2.Slice(0, numCategories2)) 1982Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
134chars = scratch.Slice(0, scratchCount).ToArray();
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (2)
1618foreach (char c in setChars.Slice(0, numChars)) 1695return new StartingLiteralData(setChars: setChars.Slice(0, numChars).ToString(), negated: RegexCharClass.IsNegated(node.Str!));
src\runtime\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(); 1236chars = chars.Slice(0, RegexCharClass.GetSetChars(nextChild.Str!, chars));
System.Threading.AccessControl (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
50return GetAndTrimString(stackBuffer.Slice(0, length));
System.Web.HttpUtility (15)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (10)
93string s = _chars.Slice(0, _pos).ToString(); 101public ReadOnlySpan<char> AsSpan() => _chars.Slice(0, _pos); 102public ReadOnlySpan<char> AsSpan(int start) => _chars.Slice(start, _pos - start); 103public ReadOnlySpan<char> AsSpan(int start, int length) => _chars.Slice(start, length); 113_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 114_chars.Slice(index, count).Fill(value); 133_chars.Slice(index, remaining).CopyTo(_chars.Slice(index + count)); 201Span<char> dst = _chars.Slice(_pos, count); 231return _chars.Slice(origPos, length); 267_chars.Slice(0, _pos).CopyTo(poolArray);
System\Web\HttpUtility.cs (1)
209return HttpEncoder.UrlDecode(bytes.Slice(0, encodedBytes));
System\Web\Util\HttpEncoder.cs (4)
238return decodedBytes.Slice(0, decodedBytesCount).ToArray(); 467return UrlEncode(byteSpan.Slice(0, encodedBytes)); 634_numChars += _encoding.GetChars(_byteBuffer.Slice(0, _numBytes), _charBuffer.Slice(_numChars)); 678Span<char> chars = _charBuffer.Slice(0, _numChars);
System.Windows.Forms (8)
System\Windows\Forms\Components\ImageList\ImageListStreamer.cs (1)
43RunLengthEncoder.TryEncode(input, writer.Span[writer.Position..], out int written);
System\Windows\Forms\Rendering\ControlPaint.cs (7)
618allData = allData[topWidth..]; 620allData = allData[topWidth..]; 622allData = allData[leftWidth..]; 624allData = allData[leftWidth..]; 626allData = allData[bottomWidth..]; 628allData = allData[bottomWidth..]; 630allData = allData[rightWidth..];
System.Windows.Forms.Design (4)
System\ComponentModel\Design\ByteViewer.cs (1)
211lineBuffer[i].TryFormat(charsBuffer.Slice(charsWritten, 2), out _, "X2");
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (2)
307guid.TryFormat(chars[prefix.Length..], out _); 308chars[prefix.Length..].Replace('-', '_');
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (1)
1021baseName.AsSpan(i).Replace(span[i..], '`', '_');
System.Windows.Forms.Primitives (10)
_generated\12\Windows.Win32.byte.InlineArrays.g.cs (2)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 107 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\19\Windows.Win32.char.InlineArrays.g.cs (5)
79 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 143 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 207 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 271 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear(); 335 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\197\Windows.Win32.int.InlineArrays.g.cs (1)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();
_generated\426\Windows.Win32.PInvoke.USER32.dll.g.cs (1)
865 lpchText = lpchText.Slice(0, wstrlpchText.Length);
_generated\568\Windows.Win32.uint.InlineArrays.g.cs (1)
61 result.AsSpan().Slice(initLength, SpanLength - initLength).Clear();