4161 references to Length
aspire (3)
src\Shared\CircularBuffer.cs (3)
107var overflowItem = data[data.Length - 1]; 109var shiftLength = data.Length - internalIndex - 1; 123data.Slice(internalIndex, data.Length - internalIndex - 1).CopyTo(data.Slice(internalIndex + 1));
Aspire.Dashboard (4)
src\Shared\CircularBuffer.cs (3)
107var overflowItem = data[data.Length - 1]; 109var shiftLength = data.Length - internalIndex - 1; 123data.Slice(internalIndex, data.Length - internalIndex - 1).CopyTo(data.Slice(internalIndex + 1));
src\Shared\CompareHelpers.cs (1)
30Debug.Assert(encodedByteCount == requestBytesSpan.Length, "Should match because span was previously trimmed to byte count value.");
Aspire.Hosting (6)
Orchestrator\ApplicationOrchestrator.cs (1)
407return value[..^suffixSpan.Length];
src\Shared\CircularBuffer.cs (3)
107var overflowItem = data[data.Length - 1]; 109var shiftLength = data.Length - internalIndex - 1; 123data.Slice(internalIndex, data.Length - internalIndex - 1).CopyTo(data.Slice(internalIndex + 1));
src\Shared\CompareHelpers.cs (1)
30Debug.Assert(encodedByteCount == requestBytesSpan.Length, "Should match because span was previously trimmed to byte count value.");
src\Shared\PasswordGenerator.cs (1)
80Debug.Assert(destination.Length >= minValues);
Aspire.Playground.Tests (1)
src\Shared\PasswordGenerator.cs (1)
80Debug.Assert(destination.Length >= minValues);
cdac-build-tool (2)
ObjectFileScraper.cs (2)
143GetBytes(_position, buffer.Length).CopyTo(buffer); 144_position += buffer.Length;
GenerateDocumentationAndConfigFiles (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (5)
208if (destination.Length < HashLengthInBytes) 233if (destination.Length < HashLengthInBytes) 270if (destination.Length < HashLengthInBytes) 295if (destination.Length < HashLengthInBytes) 329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (1)
108if (destination.Length >= sizeof(ulong) * 2)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (2)
333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 336state.BufferedCount = (uint)remaining.Length;
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (6)
694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 727Debug.Assert(keys.Length == values.Length); 738Debug.Assert(values.Length == keys.Length); 978Debug.Assert(values.Length == keys.Length); 1252if ((uint)i < (uint)values.Length) // check to see if we have values
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
40if (bitArrayIndex < (uint)span.Length) 55bitArrayIndex < (uint)span.Length &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (3)
175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 184if (charsWritten == tempBuffer.Length) 200int destLength = bytes.Length;
ILCompiler.Compiler (48)
Compiler\ObjectWriter\ElfObjectWriter.Aot.cs (12)
114if (armUnwindInfo.Length <= 3) 118unwindWord[2] = (byte)(armUnwindInfo.Length > 0 ? armUnwindInfo[0] : 0xB0); 119unwindWord[1] = (byte)(armUnwindInfo.Length > 1 ? armUnwindInfo[1] : 0xB0); 120unwindWord[0] = (byte)(armUnwindInfo.Length > 2 ? armUnwindInfo[2] : 0xB0); 125Debug.Assert(armUnwindInfo.Length <= 1024); 128unwindWord[2] = (byte)(((armUnwindInfo.Length - 2) + 3) / 4); 146while (armUnwindInfo.Length > 0) 148unwindWord[3] = (byte)(armUnwindInfo.Length > 0 ? armUnwindInfo[0] : 0xB0); 149unwindWord[2] = (byte)(armUnwindInfo.Length > 1 ? armUnwindInfo[1] : 0xB0); 150unwindWord[1] = (byte)(armUnwindInfo.Length > 2 ? armUnwindInfo[2] : 0xB0); 151unwindWord[0] = (byte)(armUnwindInfo.Length > 3 ? armUnwindInfo[3] : 0xB0); 153armUnwindInfo = armUnwindInfo.Length > 3 ? armUnwindInfo.Slice(4) : Span<byte>.Empty;
Compiler\ObjectWriter\MachObjectWriter.Aot.cs (2)
172for (int i = 0; i < registerOffset.Length; i++) 209for (int i = 0; i < registerOffset.Length; i++)
Compiler\ReachabilityInstrumentationFilter.cs (1)
41if (reader.Read(guidBytes) != guidBytes.Length)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (6)
88if (actualSize < bytes.Length) 91bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill(0x80); 92bytes[bytes.Length - 1] = 0x00; 99if (actualSize < bytes.Length) 103bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill((byte)(padValue | 0x80)); 104bytes[bytes.Length - 1] = padValue;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (1)
985BinaryPrimitives.WriteUInt16LittleEndian(tempBuffer.Slice(4), (ushort)buffer.Length);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (5)
143if (currentBuffer.Length >= buffer.Length) 145currentBuffer.Slice(0, buffer.Length).CopyTo(buffer); 146bytesRead += buffer.Length; 147_position += buffer.Length; 148_bufferPosition += buffer.Length;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\StringTableBuilder.cs (3)
92int l = 0, h = input.Length; 129if (input.Length <= 1) 133if (input.Length == 2)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmSection.cs (1)
103Debug.Assert(encodedSize == contentPrefix.Length);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmInstructions.cs (3)
292Debug.Assert(buffer.Length >= EncodeRelocationCount()); 298for (int i = 0; i < buffer.Length; i++) 345Debug.Assert(buffer.Length >= relocSize);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
ILCompiler.ReadyToRun (26)
Compiler\DependencyAnalysis\ReadyToRun\DebugDirectoryEntryNode.cs (1)
249Debug.Assert(checksumLocation.Length == ChecksumSize);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (6)
88if (actualSize < bytes.Length) 91bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill(0x80); 92bytes[bytes.Length - 1] = 0x00; 99if (actualSize < bytes.Length) 103bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill((byte)(padValue | 0x80)); 104bytes[bytes.Length - 1] = padValue;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (1)
985BinaryPrimitives.WriteUInt16LittleEndian(tempBuffer.Slice(4), (ushort)buffer.Length);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (5)
143if (currentBuffer.Length >= buffer.Length) 145currentBuffer.Slice(0, buffer.Length).CopyTo(buffer); 146bytesRead += buffer.Length; 147_position += buffer.Length; 148_bufferPosition += buffer.Length;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\StringTableBuilder.cs (3)
92int l = 0, h = input.Length; 129if (input.Length <= 1) 133if (input.Length == 2)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmDataSection.cs (1)
50Debug.Assert(headerBuffer.Slice(1).Length == Relocation.WASM_PADDED_RELOC_SIZE_32);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmDataSegment.cs (5)
89Debug.Assert(headerBuffer.Slice(len).Length == Relocation.WASM_PADDED_RELOC_SIZE_32); 91len += headerBuffer.Slice(len).Length; 98Debug.Assert(headerBuffer.Slice(len).Length == Relocation.WASM_PADDED_RELOC_SIZE_32, $"{headerBuffer.Slice(len).Length} != {Relocation.WASM_PADDED_RELOC_SIZE_32}"); 100len += headerBuffer.Slice(len).Length;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmSection.cs (1)
103Debug.Assert(encodedSize == contentPrefix.Length);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmInstructions.cs (3)
292Debug.Assert(buffer.Length >= EncodeRelocationCount()); 298for (int i = 0; i < buffer.Length; i++) 345Debug.Assert(buffer.Length >= relocSize);
ILCompiler.TypeSystem (14)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
illink (14)
ILLink.RoslynAnalyzer (20)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
libmscordaccore_universal (18)
Entrypoints.cs (18)
107return readFromTarget(address, bufferPtr, (uint)buffer.Length, delegateContext); 114return writeToTarget(address, bufferPtr, (uint)buffer.Length, delegateContext); 123return readThreadContext(threadId, contextFlags, (uint)buffer.Length, bufferPtr, delegateContext); 126byte* alignedBuffer = (byte*)NativeMemory.AlignedAlloc((nuint)buffer.Length, ContextAlignment); 127NativeMemory.Clear(alignedBuffer, (nuint)buffer.Length); 130int hr = readThreadContext(threadId, contextFlags, (uint)buffer.Length, alignedBuffer, delegateContext); 133new ReadOnlySpan<byte>(alignedBuffer, buffer.Length).CopyTo(buffer); 429return dataTarget.ReadVirtual(address, bufferPtr, (uint)buffer.Length, &bytesRead); 437return dataTarget.WriteVirtual(address, bufferPtr, (uint)buffer.Length, &bytesWritten); 444return dataTarget.GetThreadContext(threadId, contextFlags, (uint)bufferToFill.Length, bufferPtr); 503int hr = dataTarget.ReadVirtual(address, bufferPtr, (uint)buffer.Length, &bytesRead); 504return hr >= 0 && bytesRead != (uint)buffer.Length 516return mutableDataTarget.WriteVirtual(address, bufferPtr, (uint)buffer.Length); 525return dataTarget.GetThreadContext(threadId, contextFlags, (uint)bufferToFill.Length, bufferPtr); 528byte* alignedBuffer = (byte*)NativeMemory.AlignedAlloc((nuint)bufferToFill.Length, ContextAlignment); 529NativeMemory.Clear(alignedBuffer, (nuint)bufferToFill.Length); 535(uint)bufferToFill.Length, 539new ReadOnlySpan<byte>(alignedBuffer, bufferToFill.Length).CopyTo(bufferToFill);
Microsoft.AspNetCore.Antiforgery (10)
Internal\DefaultAntiforgeryTokenGenerator.cs (1)
214if (token.ClaimUid.Length != claimUidBytes.Length)
Internal\DefaultClaimUidExtractor.cs (1)
116Debug.Assert(destination.Length >= SHA256.HashSizeInBytes);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (8)
105if (_index + count > _buffer.Length) 107throw new InvalidOperationException($"Cannot advance past the end of the buffer. Current position: {_index}, Capacity: {_buffer.Length}, Requested advance: {count}."); 127var bufferSpace = _buffer.Length - _index; 131var rentedInitialSize = _buffer.Length + Math.Max(sizeHint, _buffer.Length); 144var availableSpace = _buffer.Length - _index; 151var growBy = Math.Max(sizeHint, _buffer.Length); 152var newSize = checked(_buffer.Length + growBy);
Microsoft.AspNetCore.Components (11)
ParameterView.cs (3)
217if (oldDirectParameterFrames.Length == 0) 224if (newDirectParameterFrames.Length < oldDirectParameterFrames.Length)
PersistentState\PersistentStateValueProviderKeyResolver.cs (1)
112keyBuffer = keyBuffer[..(preKey.Length + currentBuffer.Length)];
src\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (7)
20if (destination.Length < source.Length) 52if (sourceIndex == buffer.Length) 155if (sourceIndex == buffer.Length) 303if (scan == buffer.Length) 385return buffer.Length; 396if (sourceIndex == buffer.Length) 491if (sourceIndex == buffer.Length)
Microsoft.AspNetCore.Components.Endpoints (10)
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
156for (var i = 0; i < componentIdsInDepthOrder.Length; i++)
Rendering\TypeNameHash.cs (1)
26written = typeNameBytes.Length;
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (8)
105if (_index + count > _buffer.Length) 107throw new InvalidOperationException($"Cannot advance past the end of the buffer. Current position: {_index}, Capacity: {_buffer.Length}, Requested advance: {count}."); 127var bufferSpace = _buffer.Length - _index; 131var rentedInitialSize = _buffer.Length + Math.Max(sizeHint, _buffer.Length); 144var availableSpace = _buffer.Length - _index; 151var growBy = Math.Max(sizeHint, _buffer.Length); 152var newSize = checked(_buffer.Length + growBy);
Microsoft.AspNetCore.Components.Forms (6)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (6)
27_nextEndIndex = _currentBuffer.Length; 33_nextEndIndex = _currentBuffer.Length; 36public readonly bool Empty => _nextEndIndex == _currentBuffer.Length; 59var sizeToRent = _currentBuffer.Length + Math.Max(MinimumRentedArraySize, remainingLength * 2); 63var newEndIndex = newBuffer.Length - _currentBuffer.Length + _nextEndIndex; 85startIndex = _currentBuffer.Length - remainingLength;
Microsoft.AspNetCore.Components.QuickGrid (1)
Columns\GridSort.cs (1)
181var nextPos = chars.Length;
Microsoft.AspNetCore.Components.Server (11)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
249Debug.Assert(span.Length >= _bytesWritten);
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\BufferWriter.cs (4)
162if (_span.Length >= source.Length) 180if (_span.Length < count) 234if (_span.Length == 0) 239var writable = Math.Min(bytesLeftToCopy, _span.Length);
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (6)
457if (firstSpan.Length >= destination.Length) 459firstSpan.Slice(0, destination.Length).CopyTo(destination); 468if (this.Remaining < destination.Length) 474Debug.Assert(firstSpan.Length < destination.Length, "firstSpan.Length < destination.Length"); 484int toCopy = Math.Min(nextSpan.Length, destination.Length - copied); 487if (copied >= destination.Length)
Microsoft.AspNetCore.Components.Web (6)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (6)
27_nextEndIndex = _currentBuffer.Length; 33_nextEndIndex = _currentBuffer.Length; 36public readonly bool Empty => _nextEndIndex == _currentBuffer.Length; 59var sizeToRent = _currentBuffer.Length + Math.Max(MinimumRentedArraySize, remainingLength * 2); 63var newEndIndex = newBuffer.Length - _currentBuffer.Length + _nextEndIndex; 85startIndex = _currentBuffer.Length - remainingLength;
Microsoft.AspNetCore.DataProtection (24)
Cng\CbcAuthenticatedEncryptor.cs (2)
165pbOutput: (buffer.Length > 0) ? pbBuffer : &dummy, 166cbOutput: (uint)buffer.Length,
Managed\AesGcmAuthenticatedEncryptor.cs (2)
124_keyDerivationKey.WriteSecretIntoBuffer(decryptedKdkUnsafe, decryptedKdk.Length); 264_keyDerivationKey.WriteSecretIntoBuffer(decryptedKdkUnsafe, decryptedKdk.Length);
Managed\ManagedAuthenticatedEncryptor.cs (2)
132_keyDerivationKey.WriteSecretIntoBuffer(decryptedKdkUnsafe, decryptedKdk.Length); 230_keyDerivationKey.WriteSecretIntoBuffer(decryptedKdkUnsafe, decryptedKdk.Length);
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (10)
80var outputCount = operationSubkey.Length + validationSubkey.Length; 112prfInput[prfInput.Length - 4] = (byte)(outputSizeInBits >> 24); 113prfInput[prfInput.Length - 3] = (byte)(outputSizeInBits >> 16); 114prfInput[prfInput.Length - 2] = (byte)(outputSizeInBits >> 8); 115prfInput[prfInput.Length - 1] = (byte)(outputSizeInBits); 146CryptoUtil.Assert(prfOutputSizeInBytes == prfOutput.Length, "prfOutputSizeInBytes == prfOutput.Length"); 152var bytesToWrite = Math.Min(numBytesToCopyThisIteration, operationSubkey.Length - operationSubKeyIndex); 154if (operationSubKeyIndex < operationSubkey.Length) // meaning we need to write to operationSubKey 161if (operationSubKeyIndex == operationSubkey.Length && leftOverBytes != 0) // we have filled the operationSubKey. It's time for the validationSubKey
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (8)
105if (_index + count > _buffer.Length) 107throw new InvalidOperationException($"Cannot advance past the end of the buffer. Current position: {_index}, Capacity: {_buffer.Length}, Requested advance: {count}."); 127var bufferSpace = _buffer.Length - _index; 131var rentedInitialSize = _buffer.Length + Math.Max(sizeHint, _buffer.Length); 144var availableSpace = _buffer.Length - _index; 151var growBy = Math.Max(sizeHint, _buffer.Length); 152var newSize = checked(_buffer.Length + growBy);
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (8)
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (8)
105if (_index + count > _buffer.Length) 107throw new InvalidOperationException($"Cannot advance past the end of the buffer. Current position: {_index}, Capacity: {_buffer.Length}, Requested advance: {count}."); 127var bufferSpace = _buffer.Length - _index; 131var rentedInitialSize = _buffer.Length + Math.Max(sizeHint, _buffer.Length); 144var availableSpace = _buffer.Length - _index; 151var growBy = Math.Max(sizeHint, _buffer.Length); 152var newSize = checked(_buffer.Length + growBy);
Microsoft.AspNetCore.Http (1)
src\aspnetcore\src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (1)
560for (var i = 0; i < localSpan.Length; ++i)
Microsoft.AspNetCore.Http.Abstractions (15)
Extensions\HttpResponseWritingExtensions.cs (1)
78if (encodedLength <= destination.Length)
src\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (7)
20if (destination.Length < source.Length) 52if (sourceIndex == buffer.Length) 155if (sourceIndex == buffer.Length) 303if (scan == buffer.Length) 385return buffer.Length; 396if (sourceIndex == buffer.Length) 491if (sourceIndex == buffer.Length)
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (7)
33if ((uint)pos < (uint)span.Length) 47Debug.Assert(_pos == _span.Length); 78int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _span.Length + additionalCapacityRequired); 88nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
Microsoft.AspNetCore.Http.Connections (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
249Debug.Assert(span.Length >= _bytesWritten);
Microsoft.AspNetCore.Http.Extensions (23)
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (7)
33if ((uint)pos < (uint)span.Length) 47Debug.Assert(_pos == _span.Length); 78int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _span.Length + additionalCapacityRequired); 88nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (16)
38Debug.Assert(value <= _chars.Length); 43public int Capacity => _chars.Length; 51if ((uint)capacity > (uint)_chars.Length) 137if (_pos > _chars.Length - count) 157if (_pos > (_chars.Length - count)) 172if ((uint)pos < (uint)_chars.Length) 192if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 206if (pos > _chars.Length - s.Length) 217if (_pos > _chars.Length - count) 223for (int i = 0; i < dst.Length; i++) 233if (pos > _chars.Length - length) 239for (int i = 0; i < dst.Length; i++) 249if (pos > _chars.Length - value.Length) 262if (origPos > _chars.Length - length) 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 293char[] poolArray = ArrayPool<char>.Shared.Rent((int)Math.Max((uint)(_pos + additionalCapacityBeyondPos), (uint)_chars.Length * 2));
Microsoft.AspNetCore.HttpLogging (31)
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (8)
105if (_index + count > _buffer.Length) 107throw new InvalidOperationException($"Cannot advance past the end of the buffer. Current position: {_index}, Capacity: {_buffer.Length}, Requested advance: {count}."); 127var bufferSpace = _buffer.Length - _index; 131var rentedInitialSize = _buffer.Length + Math.Max(sizeHint, _buffer.Length); 144var availableSpace = _buffer.Length - _index; 151var growBy = Math.Max(sizeHint, _buffer.Length); 152var newSize = checked(_buffer.Length + growBy);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (7)
33if ((uint)pos < (uint)span.Length) 47Debug.Assert(_pos == _span.Length); 78int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _span.Length + additionalCapacityRequired); 88nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (16)
38Debug.Assert(value <= _chars.Length); 43public int Capacity => _chars.Length; 51if ((uint)capacity > (uint)_chars.Length) 137if (_pos > _chars.Length - count) 157if (_pos > (_chars.Length - count)) 172if ((uint)pos < (uint)_chars.Length) 192if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 206if (pos > _chars.Length - s.Length) 217if (_pos > _chars.Length - count) 223for (int i = 0; i < dst.Length; i++) 233if (pos > _chars.Length - length) 239for (int i = 0; i < dst.Length; i++) 249if (pos > _chars.Length - value.Length) 262if (origPos > _chars.Length - length) 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 293char[] poolArray = ArrayPool<char>.Shared.Rent((int)Math.Max((uint)(_pos + additionalCapacityBeyondPos), (uint)_chars.Length * 2));
Microsoft.AspNetCore.OpenApi (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
249Debug.Assert(span.Length >= _bytesWritten);
Microsoft.AspNetCore.OutputCaching (4)
FormatterBinaryWriter.cs (2)
116length = span.Length; 200var toWrite = Math.Min(value.Length, available.Length);
RecyclableSequenceBuilder.cs (2)
92if (available.Length >= buffer.Length) 100var toWrite = Math.Min(buffer.Length, available.Length);
Microsoft.AspNetCore.Razor.Runtime (2)
Runtime\TagHelpers\TagHelperRunner.cs (2)
37for (var i = 0; i < tagHelpers.Length; i++) 42return Awaited(task, executionContext, i + 1, tagHelpers.Length);
Microsoft.AspNetCore.Razor.Utilities.Shared (10)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\ArgHelper.cs (1)
184if (destination.Length < expectedLength)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\ImmutableArrayExtensions_Unsafe.cs (1)
181var length = items.Length;
Utilities\Hashing\NonCryptographicHashAlgorithm.cs (5)
207if (destination.Length < HashLengthInBytes) 232if (destination.Length < HashLengthInBytes) 269if (destination.Length < HashLengthInBytes) 294if (destination.Length < HashLengthInBytes) 328Debug.Assert(destination.Length == HashLengthInBytes);
Utilities\Hashing\XxHash128.cs (1)
106if (destination.Length >= sizeof(ulong) * 2)
Utilities\Hashing\XxHashShared.cs (2)
332Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 335state.BufferedCount = (uint)remaining.Length;
Microsoft.AspNetCore.Routing (14)
Matching\DefaultEndpointSelector.cs (3)
26switch (candidateState.Length) 63for (var i = 0; i < candidateState.Length; i++) 112for (var i = 0; i < candidateState.Length; i++)
Matching\FastPathTokenizer.cs (2)
27while ((end = span.IndexOf('/')) >= 0 && count < segments.Length) 36if (length > 0 && count < segments.Length)
Matching\HttpMethodMatcherPolicy.cs (2)
399for (var i = 0; i < methods.Length; i++) 408for (var i = 0; i < methods.Length; i++)
Matching\ILEmitTrieFactory.cs (7)
128if (groups.Length < binarySearchThreshold) 132for (var i = 0; i < groups.Length; i++) 153var mid = groups.Length / 2; 348if (groups.Length < binarySearchThreshold) 368var mid = groups.Length / 2; 473if (disableBinarySearch || groups.Length < binarySearchThreshold) 500var mid = groups.Length / 2;
Microsoft.AspNetCore.Server.HttpSys (23)
_generated\78\Windows.Win32.PInvoke.HTTPAPI.dll.g.cs (2)
397 uint __result = PInvoke.HttpReceiveRequestEntityBody(RequestQueueHandleLocal, RequestId, Flags, (void* )EntityBufferLocal, (uint )EntityBuffer.Length, BytesReturnedLocal, Overlapped); 426 uint __result = PInvoke.HttpReceiveRequestEntityBody(RequestQueueHandleLocal, RequestId, Flags, (void* )EntityBufferLocal, (uint )EntityBuffer.Length, default(uint* ), Overlapped);
RequestProcessing\RequestContext.cs (2)
293outputSize: (uint)destination.Length, 350outputSize: (uint)output.Length,
RequestProcessing\Response.cs (3)
315_nativeResponse.Base.EntityChunkCount = checked((ushort)dataChunks.Length); 554if (unknownHeaders.Length == 0) 585if (knownHeaderInfo.Length == 0)
RequestProcessing\ResponseBody.cs (1)
265Debug.Assert(currentChunk == dataChunks.Length, "All chunks should be accounted for");
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (4)
23if (raw[0] != '/' && !(raw.Length == 1 && raw[0] == '*')) 60while (scan < raw.Length && raw[scan] != '?') 75if (raw.Length < 7) 113if (raw.Length < 8)
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (5)
23Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero."); 26if (rawPath.Length == 0) 33if (rawPath.Length == 1 && rawPath[0] == (byte)'*') 59var end = rawPath.Length; 162if (reader == buffer.Length)
src\aspnetcore\src\Shared\PathNormalizer\PathNormalizer.cs (4)
24while (src.Length > readPointer) 30return src.Length; 36writtenLength += src.Length - readPointer; 47var remainingLength = src.Length - readPointer;
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (2)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length);
Microsoft.AspNetCore.Server.IIS (26)
Core\IISHttpContext.cs (2)
328if (rawUrlInBytes.Length == 0) 335if (rawUrlInBytes.Length > 0 && rawUrlInBytes[^1] == 0)
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RawUrlHelper.cs (4)
23if (raw[0] != '/' && !(raw.Length == 1 && raw[0] == '*')) 60while (scan < raw.Length && raw[scan] != '?') 75if (raw.Length < 7) 113if (raw.Length < 8)
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (5)
23Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero."); 26if (rawPath.Length == 0) 33if (rawPath.Length == 1 && rawPath[0] == (byte)'*') 59var end = rawPath.Length; 162if (reader == buffer.Length)
src\aspnetcore\src\Shared\PathNormalizer\PathNormalizer.cs (4)
24while (src.Length > readPointer) 30return src.Length; 36writtenLength += src.Length - readPointer; 47var remainingLength = src.Length - readPointer;
src\aspnetcore\src\Shared\ServerInfrastructure\BufferExtensions.cs (5)
120if (sourceLength <= dest.Length) 139if (number < 10 && buffer.Length >= 1) 144else if (number < 100 && buffer.Length >= 2) 153else if (number < 1000 && buffer.Length >= 3) 201if (sourceLength <= dest.Length)
src\aspnetcore\src\Shared\ServerInfrastructure\BufferWriter.cs (4)
93if (_span.Length >= source.Length) 111if (_span.Length < count) 140if (_span.Length == 0) 145var writable = Math.Min(source.Length, _span.Length);
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (2)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length);
Microsoft.AspNetCore.Server.Kestrel.Core (79)
Internal\Http\Http1Connection.cs (9)
426Debug.Assert(target.Length != 0, "Request target must be non-zero length"); 436else if (ch == ByteAsterisk && target.Length == 1) 474if (target.Length == 1) 491previousValue == null || previousValue.Length != target.Length || 522if (target.Length == targetPath.Length) 562var queryLength = query.Length; 610previousValue == null || previousValue.Length != target.Length || 668previousValue == null || previousValue.Length != target.Length || 728previousValue == null || previousValue.Length != query.Length ||
Internal\Http\HttpParser.cs (1)
244if (terminatorSize == -1 || !TryTakeSingleHeader(handler, headerSpan.Slice(0, headerSpan.Length - terminatorSize)))
Internal\Http\PathDecoder.cs (1)
38if (path.Length == pathLength && queryLength == 0)
Internal\Infrastructure\HttpUtilities.cs (1)
101Debug.Assert(written == destination.Length);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (8)
105if (_index + count > _buffer.Length) 107throw new InvalidOperationException($"Cannot advance past the end of the buffer. Current position: {_index}, Capacity: {_buffer.Length}, Requested advance: {count}."); 127var bufferSpace = _buffer.Length - _index; 131var rentedInitialSize = _buffer.Length + Math.Max(sizeHint, _buffer.Length); 144var availableSpace = _buffer.Length - _index; 151var growBy = Math.Max(sizeHint, _buffer.Length); 152var newSize = checked(_buffer.Length + growBy);
src\aspnetcore\src\Shared\PathNormalizer\PathNormalizer.cs (4)
24while (src.Length > readPointer) 30return src.Length; 36writtenLength += src.Length - readPointer; 47var remainingLength = src.Length - readPointer;
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
34if (destination.Length != 0) 90if ((uint)destination.Length >= 2) 122if ((uint)destination.Length >= 2) 154if ((uint)destination.Length >= 2) 192if ((uint)destination.Length != 0) 272if ((uint)destination.Length >= 3) 305if ((uint)destination.Length >= 3) 344if ((uint)destination.Length >= 2) 371if (destination.Length != 0) 379if (value.Length <= destination.Length) 397Debug.Assert(destination.Length >= value.Length); 421if (destination.Length != 0) 429if (value.Length <= destination.Length) 460if (destination.Length != 0) 472if (encodedStringLength <= destination.Length) 503if (destination.Length != 0) 526if (destination.Length != 0) 553if (destination.Length >= valueLength) 639span = new byte[span.Length * 2];
src\aspnetcore\src\Shared\runtime\Http2\Hpack\Huffman.cs (5)
680Debug.Assert(dst.Length > 0); 712if (j == dst.Length) 714Array.Resize(ref dstArray, dst.Length * 2); 779if (j == dst.Length) 781Array.Resize(ref dstArray, dst.Length * 2);
src\aspnetcore\src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (3)
28if (destination.Length == 0) 47if (1 == destination.Length) 60if (i >= destination.Length)
src\aspnetcore\src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
45if (buffer.Length != 0)
src\aspnetcore\src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
154if (buffer.Length != 0)
src\aspnetcore\src\Shared\runtime\Http3\QPack\QPackEncoder.cs (8)
69if (destination.Length >= 2) 184if (buffer.Length != 0) 195if (buffer.Length >= encodedStringLength) 233if (buffer.Length > 0) 258if (buffer.Length >= valueLength) 303Debug.Assert(buffer.Length >= s.Length); 320if (buffer.Length != 0) 328if (buffer.Length >= s.Length)
src\aspnetcore\src\Shared\ServerInfrastructure\BufferExtensions.cs (5)
120if (sourceLength <= dest.Length) 139if (number < 10 && buffer.Length >= 1) 144else if (number < 100 && buffer.Length >= 2) 153else if (number < 1000 && buffer.Length >= 3) 201if (sourceLength <= dest.Length)
src\aspnetcore\src\Shared\ServerInfrastructure\BufferWriter.cs (4)
93if (_span.Length >= source.Length) 111if (_span.Length < count) 140if (_span.Length == 0) 145var writable = Math.Min(source.Length, _span.Length);
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (2)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length);
src\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (7)
20if (destination.Length < source.Length) 52if (sourceIndex == buffer.Length) 155if (sourceIndex == buffer.Length) 303if (scan == buffer.Length) 385return buffer.Length; 396if (sourceIndex == buffer.Length) 491if (sourceIndex == buffer.Length)
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (1)
TlsEventPump.cs (1)
1243if (count == expired.Length)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (2)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length);
Microsoft.AspNetCore.SignalR.Common (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
249Debug.Assert(span.Length >= _bytesWritten);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
249Debug.Assert(span.Length >= _bytesWritten);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
249Debug.Assert(span.Length >= _bytesWritten);
Microsoft.AspNetCore.SignalR.Specification.Tests (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
249Debug.Assert(span.Length >= _bytesWritten);
Microsoft.AspNetCore.SignalR.StackExchangeRedis (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
249Debug.Assert(span.Length >= _bytesWritten);
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
415for (var i = 0; i < states.Length; i++)
Microsoft.AspNetCore.WebSockets (23)
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (7)
33if ((uint)pos < (uint)span.Length) 47Debug.Assert(_pos == _span.Length); 78int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _span.Length + additionalCapacityRequired); 88nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (16)
38Debug.Assert(value <= _chars.Length); 43public int Capacity => _chars.Length; 51if ((uint)capacity > (uint)_chars.Length) 137if (_pos > _chars.Length - count) 157if (_pos > (_chars.Length - count)) 172if ((uint)pos < (uint)_chars.Length) 192if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 206if (pos > _chars.Length - s.Length) 217if (_pos > _chars.Length - count) 223for (int i = 0; i < dst.Length; i++) 233if (pos > _chars.Length - length) 239for (int i = 0; i < dst.Length; i++) 249if (pos > _chars.Length - value.Length) 262if (origPos > _chars.Length - length) 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 293char[] poolArray = ArrayPool<char>.Shared.Rent((int)Math.Max((uint)(_pos + additionalCapacityBeyondPos), (uint)_chars.Length * 2));
Microsoft.AspNetCore.WebUtilities (9)
FileBufferingReadStream.cs (1)
312else if (buffer.Length > 0)
HttpRequestStreamReader.cs (1)
172var count = buffer.Length;
src\aspnetcore\src\Shared\UrlDecoder\UrlDecoder.cs (7)
20if (destination.Length < source.Length) 52if (sourceIndex == buffer.Length) 155if (sourceIndex == buffer.Length) 303if (scan == buffer.Length) 385return buffer.Length; 396if (sourceIndex == buffer.Length) 491if (sourceIndex == buffer.Length)
Microsoft.Build (13)
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)
133if (_position + buffer.Length > _maxAllowedPosition)
Logging\OptimizedStringIndenter.cs (3)
64int indentedStringLength = segments.Length * (Environment.NewLine.Length + indent); 132if (segmentCount <= segments.Length) 144for (int i = 0; i < segments.Length; i++)
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Internal\ArraySortHelper.cs (6)
694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 727Debug.Assert(keys.Length == values.Length); 738Debug.Assert(values.Length == keys.Length); 978Debug.Assert(values.Length == keys.Length); 1252if ((uint)i < (uint)values.Length) // check to see if we have values
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Internal\BitHelper.cs (2)
40if (bitArrayIndex < (uint)span.Length) 55bitArrayIndex < (uint)span.Length &&
Microsoft.Build.Framework (36)
Collections\RefArrayBuilder.cs (11)
123if ((uint)count < (uint)span.Length) 158if (source.Length == 1 && (uint)count < (uint)span.Length) 175if ((uint)(count + source.Length) > (uint)span.Length) 201if ((uint)count < (uint)span.Length) 243if ((uint)(count + source.Length) <= (uint)span.Length) 265if ((uint)(count + source.Length) > (uint)span.Length) 289val1: span.Length != 0 ? span.Length * 2 : 4, 290val2: span.Length + size); 300nextCapacity = Math.Max(Math.Max(span.Length + 1, ArrayMaxLength), span.Length);
Coordinator\CoordinatorSettings.cs (1)
167return string.Create(prefix.Length + (hash.Length * 2), new PrefixAndHash(prefix, hash), static (span, state) =>
FileUtilities.cs (3)
789for (int i = 0; i < str.Length; i++) 806int endId = path.Length - 1; 810bool hasQuotes = path.Length > 2
Utilities\BufferScope.cs (4)
60if (initialBuffer.Length >= minimumLength) 85if (_span.Length >= capacity) 96Debug.Assert(capacity > _span.Length); 140public readonly int Length => _span.Length;
Utilities\ProcessExtensions.cs (1)
188for (int i = 0; i < decodedChars.Length; i++)
Utilities\ValueStringBuilder.cs (16)
71ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _chars.Length); 79public readonly int Capacity => _chars.Length; 97if ((uint)capacity > (uint)_chars.Length) 202if (originalLength > _chars.Length - length) 235if (_length > _chars.Length - count) 261if (_length > _chars.Length - count) 279if ((uint)pos < (uint)_chars.Length) 302if (s.Length == 1 && (uint)pos < (uint)_chars.Length) 317if (pos > _chars.Length - s.Length) 331if (_length > _chars.Length - count) 337for (int i = 0; i < dst.Length; i++) 351if (pos > _chars.Length - length) 357for (int i = 0; i < dst.Length; i++) 371if (pos > _chars.Length - value.Length) 409Debug.Assert(_length > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 417Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
Microsoft.Build.Tasks.Core (3)
ManifestUtil\mansign2.cs (3)
806nonce[nonce.Length - 1] &= 0x7f; 807nonce[nonce.Length - 1] |= 0x01; 817para.Nonce.cbData = (uint)nonce.Length;
Microsoft.CodeAnalysis (25)
CodeAnalysisEventSource.Common.cs (4)
56WriteEventCore(eventId: 4, data.Length, dataPtr); 90WriteEventCore(eventId: 6, data.Length, dataPtr); 146WriteEventCore(eventId: 17, data.Length, dataPtr); 174WriteEventCore(eventId: 18, data.Length, dataPtr);
CodeGen\PrivateImplementationDetails.cs (1)
529Debug.Assert(bytesWritten == hash.Length);
CommandLine\CommandLineParser.cs (2)
637if (lineBufferLength >= lineBuffer.Length) 639var temp = new char[lineBuffer.Length * 2];
DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (1)
452Debug.Assert(bytesWritten == hash.Length);
Hashing\NonCryptographicHashAlgorithm.cs (5)
208if (destination.Length < HashLengthInBytes) 233if (destination.Length < HashLengthInBytes) 270if (destination.Length < HashLengthInBytes) 295if (destination.Length < HashLengthInBytes) 329Debug.Assert(destination.Length == HashLengthInBytes);
Hashing\XxHash128.cs (1)
108if (destination.Length >= sizeof(ulong) * 2)
Hashing\XxHashShared.cs (2)
333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 336state.BufferedCount = (uint)remaining.Length;
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (6)
694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 727Debug.Assert(keys.Length == values.Length); 738Debug.Assert(values.Length == keys.Length); 978Debug.Assert(values.Length == keys.Length); 1252if ((uint)i < (uint)values.Length) // check to see if we have values
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
40if (bitArrayIndex < (uint)span.Length) 55bitArrayIndex < (uint)span.Length &&
Text\SourceText.cs (1)
755while (buffer.Length > 0)
Microsoft.CodeAnalysis.Analyzers (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (5)
208if (destination.Length < HashLengthInBytes) 233if (destination.Length < HashLengthInBytes) 270if (destination.Length < HashLengthInBytes) 295if (destination.Length < HashLengthInBytes) 329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (1)
108if (destination.Length >= sizeof(ulong) * 2)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (2)
333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 336state.BufferedCount = (uint)remaining.Length;
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (6)
694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 727Debug.Assert(keys.Length == values.Length); 738Debug.Assert(values.Length == keys.Length); 978Debug.Assert(values.Length == keys.Length); 1252if ((uint)i < (uint)values.Length) // check to see if we have values
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
40if (bitArrayIndex < (uint)span.Length) 55bitArrayIndex < (uint)span.Length &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (3)
175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 184if (charsWritten == tempBuffer.Length) 200int destLength = bytes.Length;
Microsoft.CodeAnalysis.AnalyzerUtilities (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (5)
208if (destination.Length < HashLengthInBytes) 233if (destination.Length < HashLengthInBytes) 270if (destination.Length < HashLengthInBytes) 295if (destination.Length < HashLengthInBytes) 329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (1)
108if (destination.Length >= sizeof(ulong) * 2)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (2)
333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 336state.BufferedCount = (uint)remaining.Length;
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (6)
694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 727Debug.Assert(keys.Length == values.Length); 738Debug.Assert(values.Length == keys.Length); 978Debug.Assert(values.Length == keys.Length); 1252if ((uint)i < (uint)values.Length) // check to see if we have values
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
40if (bitArrayIndex < (uint)span.Length) 55bitArrayIndex < (uint)span.Length &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (3)
175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 184if (charsWritten == tempBuffer.Length) 200int destLength = bytes.Length;
Microsoft.CodeAnalysis.CodeStyle (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (5)
208if (destination.Length < HashLengthInBytes) 233if (destination.Length < HashLengthInBytes) 270if (destination.Length < HashLengthInBytes) 295if (destination.Length < HashLengthInBytes) 329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (1)
108if (destination.Length >= sizeof(ulong) * 2)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (2)
333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 336state.BufferedCount = (uint)remaining.Length;
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (6)
694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 727Debug.Assert(keys.Length == values.Length); 738Debug.Assert(values.Length == keys.Length); 978Debug.Assert(values.Length == keys.Length); 1252if ((uint)i < (uint)values.Length) // check to see if we have values
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
40if (bitArrayIndex < (uint)span.Length) 55bitArrayIndex < (uint)span.Length &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (3)
175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 184if (charsWritten == tempBuffer.Length) 200int destLength = bytes.Length;
Microsoft.CodeAnalysis.CSharp (2)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (2)
1160Debug.Assert(bytesWritten == hash.Length); 1165Debug.Assert(bytesWritten == hash.Length);
Microsoft.CodeAnalysis.Extensions.Package (8)
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (6)
694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 727Debug.Assert(keys.Length == values.Length); 738Debug.Assert(values.Length == keys.Length); 978Debug.Assert(values.Length == keys.Length); 1252if ((uint)i < (uint)values.Length) // check to see if we have values
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
40if (bitArrayIndex < (uint)span.Length) 55bitArrayIndex < (uint)span.Length &&
Microsoft.CodeAnalysis.Razor.Compiler (4)
Language\CodeGeneration\CodeWriter.cs (3)
442if (source.Length > destination.Length) 444source = source[..destination.Length]; 538Debug.Assert(destination.Length == 0, "We didn't fill the whole span!");
Language\DefaultRazorProjectFileSystem.cs (1)
152Debug.Assert(span.Length == pathSpan.Length, "The span should be the same length as the path.");
Microsoft.CodeAnalysis.ResxSourceGenerator (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (5)
208if (destination.Length < HashLengthInBytes) 233if (destination.Length < HashLengthInBytes) 270if (destination.Length < HashLengthInBytes) 295if (destination.Length < HashLengthInBytes) 329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (1)
108if (destination.Length >= sizeof(ulong) * 2)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (2)
333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 336state.BufferedCount = (uint)remaining.Length;
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (6)
694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 727Debug.Assert(keys.Length == values.Length); 738Debug.Assert(values.Length == keys.Length); 978Debug.Assert(values.Length == keys.Length); 1252if ((uint)i < (uint)values.Length) // check to see if we have values
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
40if (bitArrayIndex < (uint)span.Length) 55bitArrayIndex < (uint)span.Length &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (3)
175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 184if (charsWritten == tempBuffer.Length) 200int destLength = bytes.Length;
Microsoft.CodeAnalysis.Workspaces (26)
Serialization\SerializerService_Reference.cs (1)
511Debug.Assert(stream.Length == span.Length);
src\roslyn\src\Compilers\Core\Portable\CodeAnalysisEventSource.Common.cs (4)
56WriteEventCore(eventId: 4, data.Length, dataPtr); 90WriteEventCore(eventId: 6, data.Length, dataPtr); 146WriteEventCore(eventId: 17, data.Length, dataPtr); 174WriteEventCore(eventId: 18, data.Length, dataPtr);
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (1)
452Debug.Assert(bytesWritten == hash.Length);
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (5)
208if (destination.Length < HashLengthInBytes) 233if (destination.Length < HashLengthInBytes) 270if (destination.Length < HashLengthInBytes) 295if (destination.Length < HashLengthInBytes) 329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (1)
108if (destination.Length >= sizeof(ulong) * 2)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (2)
333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 336state.BufferedCount = (uint)remaining.Length;
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (6)
694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 727Debug.Assert(keys.Length == values.Length); 738Debug.Assert(values.Length == keys.Length); 978Debug.Assert(values.Length == keys.Length); 1252if ((uint)i < (uint)values.Length) // check to see if we have values
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
40if (bitArrayIndex < (uint)span.Length) 55bitArrayIndex < (uint)span.Length &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (3)
175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 184if (charsWritten == tempBuffer.Length) 200int destLength = bytes.Length;
Workspace\Solution\Checksum.cs (1)
88Contract.ThrowIfTrue(span.Length < HashSize);
Microsoft.Data.Analysis (32)
DataFrame.cs (2)
428for (int i = 0; i < span.Length; i++) 448for (int i = 0; i < span.Length; i++)
PrimitiveColumnContainer.BinaryOperations.cs (2)
31for (var j = 0; j < leftSpan.Length; j++) 82for (var j = 0; j < rightSpan.Length; j++)
PrimitiveColumnContainer.cs (4)
186for (int i = 0; i < mutableBuffer.Length; i++) 204for (int i = 0; i < span.Length; i++) 247for (int i = 0; i < span.Length; i++) 295Debug.Assert(bitMapBufferSpan.Length >= bitMapBufferIndex);
PrimitiveDataFrameColumnComputations.cs (24)
253for (int i = 0; i < mutableSpan.Length; i++) 722for (int i = 0; i < mutableSpan.Length; i++) 740for (int i = 0; i < mutableSpan.Length; i++) 1209for (int i = 0; i < mutableSpan.Length; i++) 1227for (int i = 0; i < mutableSpan.Length; i++) 1696for (int i = 0; i < mutableSpan.Length; i++) 1714for (int i = 0; i < mutableSpan.Length; i++) 2183for (int i = 0; i < mutableSpan.Length; i++) 2201for (int i = 0; i < mutableSpan.Length; i++) 2670for (int i = 0; i < mutableSpan.Length; i++) 2688for (int i = 0; i < mutableSpan.Length; i++) 3157for (int i = 0; i < mutableSpan.Length; i++) 3175for (int i = 0; i < mutableSpan.Length; i++) 3644for (int i = 0; i < mutableSpan.Length; i++) 3662for (int i = 0; i < mutableSpan.Length; i++) 4131for (int i = 0; i < mutableSpan.Length; i++) 4149for (int i = 0; i < mutableSpan.Length; i++) 4618for (int i = 0; i < mutableSpan.Length; i++) 4636for (int i = 0; i < mutableSpan.Length; i++) 5105for (int i = 0; i < mutableSpan.Length; i++) 5123for (int i = 0; i < mutableSpan.Length; i++) 5592for (int i = 0; i < mutableSpan.Length; i++) 5610for (int i = 0; i < mutableSpan.Length; i++) 6079for (int i = 0; i < mutableSpan.Length; i++)
Microsoft.Diagnostics.DataContractReader (4)
ContractDescriptorTarget.cs (4)
554if (!success || bytesWritten != buffer.Length || dataTargetDelegates.WriteToTarget(address, buffer) < 0) 580throw new VirtualReadException($"Failed to read {buffer.Length} bytes at 0x{address:x8}."); 591throw new InvalidOperationException($"Failed to write {buffer.Length} bytes at 0x{address:x8}."); 684for (int i = 0; i < buffer.Length; i++)
Microsoft.Diagnostics.DataContractReader.Contracts (17)
Contracts\Debugger\StackPusher.cs (1)
17sp = new TargetPointer(sp.Value - (ulong)bytes.Length);
Contracts\StackWalk\Context\ContextHolder.cs (1)
37if (buffer.Length > sizeof(T))
LinearReadCache.cs (2)
62if (offset + (ulong)dest.Length > _currPageSize) 65_page.AsSpan((int)offset, dest.Length).CopyTo(dest);
PrintfStressMessageFormatter.cs (3)
188buffer[buffer.Length - paddingFormat.Precision - 1] = '.'; 198buffer[buffer.Length - paddingFormat.Precision - 1] = '.'; 199buffer[buffer.Length - paddingFormat.Precision - 2] = '0';
src\runtime\src\coreclr\tools\aot\ILCompiler.Reflection.ReadyToRun\NativeReader.cs (2)
40if (start < 0 || start + buffer.Length > _backingStream.Length) 45start += buffer.Length;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (6)
88if (actualSize < bytes.Length) 91bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill(0x80); 92bytes[bytes.Length - 1] = 0x00; 99if (actualSize < bytes.Length) 103bytes.Slice(actualSize, bytes.Length - actualSize - 1).Fill((byte)(padValue | 0x80)); 104bytes[bytes.Length - 1] = padValue;
TargetStream.cs (2)
36_offset += buffer.Length; 37return buffer.Length;
Microsoft.Diagnostics.DataContractReader.Legacy (24)
_generated\37\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface.cs (15)
327for (int __i0 = 0; __i0 < __values_native__managedSpan.Length; ++__i0) 377__values_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(values).Length; 380for (int __i0 = 0; __i0 < __values_native__nativeSpan.Length; ++__i0) 567for (int __i0 = 0; __i0 < __values_native__managedSpan.Length; ++__i0) 619__values_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(values).Length; 622for (int __i0 = 0; __i0 < __values_native__nativeSpan.Length; ++__i0) 924for (int __i0 = 0; __i0 < __modules_native__managedSpan.Length; ++__i0) 976__modules_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(modules).Length; 979for (int __i0 = 0; __i0 < __modules_native__nativeSpan.Length; ++__i0) 2319for (int __i0 = 0; __i0 < __heaps_native__managedSpan.Length; ++__i0) 2369__heaps_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(heaps).Length; 2372for (int __i0 = 0; __i0 < __heaps_native__nativeSpan.Length; ++__i0) 3986for (int __i0 = 0; __i0 < __values_native__managedSpan.Length; ++__i0) 4038__values_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(values).Length; 4041for (int __i0 = 0; __i0 < __values_native__nativeSpan.Length; ++__i0)
_generated\40\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface4.cs (3)
79for (int __i0 = 0; __i0 < __arguments_native__managedSpan.Length; ++__i0) 129__arguments_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(arguments).Length; 132for (int __i0 = 0; __i0 < __arguments_native__nativeSpan.Length; ++__i0)
_generated\46\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface10.cs (3)
89for (int __i0 = 0; __i0 < __mowList_native__managedSpan.Length; ++__i0) 141__mowList_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(mowList).Length; 144for (int __i0 = 0; __i0 < __mowList_native__nativeSpan.Length; ++__i0)
_generated\55\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSStressLogMsgEnum.cs (3)
132for (int __i0 = 0; __i0 < __args_native__managedSpan.Length; ++__i0) 182__args_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.Diagnostics.DataContractReader.Legacy.ClrDataAddress, ulong>.GetManagedValuesDestination(args).Length; 185for (int __i0 = 0; __i0 < __args_native__nativeSpan.Length; ++__i0)
Microsoft.DiaSymReader (80)
_generated\18\Microsoft.DiaSymReader.ISymUnmanagedEncUpdate.cs (3)
195for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 258__variables_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables).Length; 261for (int __i0 = 0; __i0 < __variables_native__nativeSpan.Length; ++__i0)
_generated\19\Microsoft.DiaSymReader.ISymUnmanagedMethod.cs (9)
432for (int __i0 = 0; __i0 < __parameters_native__managedSpan.Length; ++__i0) 494__parameters_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(parameters).Length; 497for (int __i0 = 0; __i0 < __parameters_native__nativeSpan.Length; ++__i0) 627for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0) 704__documents_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents).Length; 707for (int __i0 = 0; __i0 < __documents_native__nativeSpan.Length; ++__i0) 778for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0) 874__documents_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents).Length; 877for (int __i0 = 0; __i0 < __documents_native__nativeSpan.Length; ++__i0)
_generated\20\Microsoft.DiaSymReader.ISymUnmanagedMethod2.cs (3)
318for (int __i0 = 0; __i0 < __parameters_native__managedSpan.Length; ++__i0) 437for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0) 522for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0)
_generated\21\Microsoft.DiaSymReader.ISymUnmanagedNamespace.cs (6)
140for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0) 202__namespaces_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetManagedValuesDestination(namespaces).Length; 205for (int __i0 = 0; __i0 < __namespaces_native__nativeSpan.Length; ++__i0) 273for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 335__variables_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables).Length; 338for (int __i0 = 0; __i0 < __variables_native__nativeSpan.Length; ++__i0)
_generated\22\Microsoft.DiaSymReader.ISymUnmanagedReader.cs (15)
178for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0) 240__documents_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents).Length; 243for (int __i0 = 0; __i0 < __documents_native__nativeSpan.Length; ++__i0) 473for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 535__variables_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables).Length; 538for (int __i0 = 0; __i0 < __variables_native__nativeSpan.Length; ++__i0) 606for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 668__variables_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(variables).Length; 671for (int __i0 = 0; __i0 < __variables_native__nativeSpan.Length; ++__i0) 862for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0) 924__namespaces_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetManagedValuesDestination(namespaces).Length; 927for (int __i0 = 0; __i0 < __namespaces_native__nativeSpan.Length; ++__i0) 1223for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0) 1288__methods_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedMethod, global::System.IntPtr>.GetManagedValuesDestination(methods).Length; 1291for (int __i0 = 0; __i0 < __methods_native__nativeSpan.Length; ++__i0)
_generated\23\Microsoft.DiaSymReader.ISymUnmanagedReader2.cs (8)
221for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0) 286__methods_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedMethod, global::System.IntPtr>.GetManagedValuesDestination(methods).Length; 289for (int __i0 = 0; __i0 < __methods_native__nativeSpan.Length; ++__i0) 395for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0) 568for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 648for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 793for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0) 997for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0)
_generated\24\Microsoft.DiaSymReader.ISymUnmanagedReader3.cs (6)
255for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0) 428for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 508for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 653for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0) 857for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0) 1069for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0)
_generated\25\Microsoft.DiaSymReader.ISymUnmanagedReader4.cs (6)
290for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0) 463for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 543for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 688for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0) 892for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0) 1104for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0)
_generated\26\Microsoft.DiaSymReader.ISymUnmanagedReader5.cs (6)
195for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0) 368for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 448for (int __i0 = 0; __i0 < __variables_native__managedSpan.Length; ++__i0) 593for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0) 797for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0) 1009for (int __i0 = 0; __i0 < __methods_native__managedSpan.Length; ++__i0)
_generated\28\Microsoft.DiaSymReader.ISymUnmanagedScope.cs (9)
215for (int __i0 = 0; __i0 < __children_native__managedSpan.Length; ++__i0) 277__children_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedScope, global::System.IntPtr>.GetManagedValuesDestination(children).Length; 280for (int __i0 = 0; __i0 < __children_native__nativeSpan.Length; ++__i0) 480for (int __i0 = 0; __i0 < __locals_native__managedSpan.Length; ++__i0) 542__locals_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedVariable, global::System.IntPtr>.GetManagedValuesDestination(locals).Length; 545for (int __i0 = 0; __i0 < __locals_native__nativeSpan.Length; ++__i0) 613for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0) 675__namespaces_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedNamespace, global::System.IntPtr>.GetManagedValuesDestination(namespaces).Length; 678for (int __i0 = 0; __i0 < __namespaces_native__nativeSpan.Length; ++__i0)
_generated\29\Microsoft.DiaSymReader.ISymUnmanagedScope2.cs (6)
137for (int __i0 = 0; __i0 < __constants_native__managedSpan.Length; ++__i0) 199__constants_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedConstant, global::System.IntPtr>.GetManagedValuesDestination(constants).Length; 202for (int __i0 = 0; __i0 < __constants_native__nativeSpan.Length; ++__i0) 342for (int __i0 = 0; __i0 < __children_native__managedSpan.Length; ++__i0) 485for (int __i0 = 0; __i0 < __locals_native__managedSpan.Length; ++__i0) 565for (int __i0 = 0; __i0 < __namespaces_native__managedSpan.Length; ++__i0)
_generated\9\Microsoft.DiaSymReader.ISymEncUnmanagedMethod.cs (3)
252for (int __i0 = 0; __i0 < __documents_native__managedSpan.Length; ++__i0) 314__documents_native__numElements = global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Microsoft.DiaSymReader.ISymUnmanagedDocument, global::System.IntPtr>.GetManagedValuesDestination(documents).Length; 317for (int __i0 = 0; __i0 < __documents_native__nativeSpan.Length; ++__i0)
Microsoft.DotNet.Cli.Utils (4)
BufferScope.cs (4)
64if (initialBuffer.Length >= minimumLength) 89if (_span.Length >= capacity) 100Debug.Assert(capacity > _span.Length); 144public readonly int Length => _span.Length;
Microsoft.DotNet.TemplateLocator (4)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (4)
59span = span.Slice(utf8Bom.Length, span.Length - utf8Bom.Length); 82if (reader.BytesConsumed == span.Length) 84newSegmentSize = span.Length * 2; 87int remaining = (int)(span.Length - reader.BytesConsumed);
Microsoft.Extensions.AI.Abstractions (1)
Embeddings\BinaryEmbedding.cs (1)
101for (int i = 0; i < utf8.Length; i++)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
TagSetTests.cs (1)
173for (int i = 0; i < chars.Length; i++)
Microsoft.Extensions.Compliance.Abstractions (3)
Redaction\NullRedactor.cs (1)
28Throw.IfBufferTooSmall(destination.Length, source.Length, nameof(destination));
Redaction\Redactor.cs (2)
236if (rlen > destination.Length) 277if (len > destination.Length)
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Redaction\TestSpanFormattable.cs (1)
27if (destination.Length < _value.Length)
Microsoft.Extensions.Compliance.Redaction (1)
HmacRedactor.cs (1)
104Throw.IfBufferTooSmall(destination.Length, length, nameof(destination));
Microsoft.Extensions.Compliance.Testing (1)
FakeRedactor.cs (1)
79Throw.IfBufferTooSmall(destination.Length, str.Length, nameof(destination));
Microsoft.Extensions.Configuration.Binder.SourceGeneration (12)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (12)
32Debug.Assert(value <= _span.Length); 53if ((uint)pos < (uint)span.Length) 69if (source.Length == 1 && (uint)pos < (uint)span.Length) 83if ((uint)(_pos + source.Length) > (uint)_span.Length) 96if ((uint)(_pos + source.Length) > (uint)_span.Length) 113if ((uint)(pos + length) <= (uint)span.Length) 137Debug.Assert(_pos == _span.Length); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 215int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _pos + additionalCapacityBeyondPos); 225nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
Microsoft.Extensions.Configuration.EnvironmentVariables (14)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
Microsoft.Extensions.DataIngestion (14)
Chunkers\ValueStringBuilder.cs (14)
44Debug.Assert(value <= _chars.Length); 49public int Capacity => _chars.Length; 57if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
Microsoft.Extensions.Diagnostics (1)
src\runtime\src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (1)
129_maxIndex = bitMap.Length * sizeof(ulong) * 8;
Microsoft.Extensions.Identity.Core (10)
Base32.cs (7)
32for (int offset = 0; offset < bytes.Length;) 123switch (input.Length - offset) 132b1 = (offset < input.Length) ? input[offset++] : 0U; 133b2 = (offset < input.Length) ? input[offset++] : 0U; 134b3 = (offset < input.Length) ? input[offset++] : 0U; 135b4 = (offset < input.Length) ? input[offset++] : 0U; 136b5 = (offset < input.Length) ? input[offset++] : 0U;
Rfc6238AuthenticationService.cs (3)
54Debug.Assert(written == hash.Length); 68var offset = hash[hash.Length - 1] & 0xf; 69Debug.Assert(offset + 4 < hash.Length);
Microsoft.Extensions.Logging.Abstractions (14)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
Microsoft.Extensions.Logging.Console (14)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
Microsoft.Extensions.Logging.Generators (12)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (12)
32Debug.Assert(value <= _span.Length); 53if ((uint)pos < (uint)span.Length) 69if (source.Length == 1 && (uint)pos < (uint)span.Length) 83if ((uint)(_pos + source.Length) > (uint)_span.Length) 96if ((uint)(_pos + source.Length) > (uint)_span.Length) 113if ((uint)(pos + length) <= (uint)span.Length) 137Debug.Assert(_pos == _span.Length); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 215int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _pos + additionalCapacityBeyondPos); 225nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
Microsoft.Extensions.ServiceDiscovery.Dns (7)
Resolver\DnsPrimitives.cs (7)
43if (buffer.Length < DnsMessageHeader.HeaderLength) 101destination.Length < length + 2) 115if (label.Length == 0) 130else if (label.Length > 63 || 139nameBuffer[0] = (byte)label.Length; 140written += label.Length + 1; 152if (label.Length != 0)
Microsoft.Extensions.Telemetry (2)
Logging\JustInTimeRedactor.cs (2)
129if (maxLenToRedact > workBuffer.Length) 153if (redactedLen > destination.Length)
Microsoft.Extensions.Telemetry.Tests (1)
Logging\JustInTimeRedactorTests.cs (1)
124if (s.Length > destination.Length)
Microsoft.ML.Core (10)
Utilities\BigArray.cs (1)
389Contracts.Assert(0 <= length && length <= dst.Length);
Utilities\HashArray.cs (1)
237Contracts.Check(destination.Length >= _ct);
Utilities\Stream.cs (1)
703int numElementsToReadThisChunk = Math.Min(maxChunkSizeInElements, destination.Length);
Utilities\Utils.cs (4)
191Contracts.Assert(src.Count <= dst.Length); 463Contracts.Assert(0 <= lim && lim <= a.Length); 549for (int iv = 0; iv < rgv.Length; iv++) 550Swap(ref rgv[iv], ref rgv[iv + rand.Next(rgv.Length - iv)]);
Utilities\VBufferUtils.cs (3)
277for (int i = 0; i < editor.Values.Length; i++) 283for (int i = 0; i < editor.Values.Length; i++) 309int dstValuesCount = editor.Values.Length;
Microsoft.ML.Core.Tests (4)
UnitTests\TestVBuffer.cs (4)
124for (int i = 0; i < editor.Values.Length; ++i) 561for (int i = 0; i < editor.Indices.Length; ++i) 1129for (int i = 0; i < bEditor.Values.Length; ++i) 1151GenericSpanSortHelper<int>.Sort(bEditor.Indices, 0, bEditor.Indices.Length);
Microsoft.ML.CpuMath (35)
AlignedArray.cs (2)
114Contracts.Assert(0 <= index && index <= dst.Length - count); 122Contracts.Assert(0 <= index && index <= dst.Length - count);
AvxIntrinsics.cs (10)
424float* pDstEnd = pdst + dst.Length; 468int length = dst.Length; 571Contracts.Assert(count <= dst.Length); 621float* pDstEnd = pdst + dst.Length; 666Contracts.Assert(count <= dst.Length); 721Contracts.Assert(count <= result.Length); 777Contracts.Assert(count <= dst.Length); 828Contracts.Assert(count <= dst.Length); 877Contracts.Assert(count <= dst.Length); 926Contracts.Assert(count <= dst.Length);
CpuMathUtils.cs (5)
54Contracts.Assert(count <= destination.Length); 73Contracts.Assert(count <= destination.Length); 95Contracts.Assert(count <= result.Length); 113Contracts.Assert(count <= destination.Length); 134Contracts.Assert(count <= destination.Length);
CpuMathUtils.netcoreapp.cs (8)
171if (destination.Length < MinInputSize || !Sse.IsSupported) 173for (int i = 0; i < destination.Length; i++) 205Contracts.Assert(count < destination.Length); 241Contracts.Assert(count < destination.Length); 536Contracts.Assert(count <= v.Length); 537Contracts.Assert(count <= w.Length); 578Contracts.Assert(count <= v.Length); 579Contracts.Assert(count <= w.Length);
SseIntrinsics.cs (10)
359float* pDstEnd = pdst + dst.Length; 392int length = dst.Length; 490Contracts.Assert(count <= dst.Length); 528float* pDstEnd = pdst + dst.Length; 560Contracts.Assert(count <= dst.Length); 602Contracts.Assert(count <= result.Length); 645Contracts.Assert(count <= dst.Length); 684Contracts.Assert(count <= dst.Length); 721Contracts.Assert(count <= dst.Length); 758Contracts.Assert(count <= dst.Length);
Microsoft.ML.Data (12)
Deprecated\Vector\GenericSpanSortHelper.cs (9)
50Contracts.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!"); 93Contracts.Assert(length <= keys.Length); 94Contracts.Assert(length + left <= keys.Length); 95Contracts.Assert(length + left <= values.Length); 106Contracts.Assert(hi < keys.Length); 152Contracts.Assert(hi < keys.Length); 195Contracts.Assert(hi < keys.Length); 212Contracts.Assert(lo < keys.Length); 238Contracts.Assert(hi <= keys.Length);
Deprecated\Vector\VectorUtils.cs (1)
444Contracts.CheckParam(src.Length == dst.Length, nameof(dst), "Arrays must have the same dimensionality.");
Scorers\FeatureContributionCalculation.cs (1)
241var count = values.Length;
Transforms\ValueToKeyMappingTransformerImpl.cs (1)
660Contracts.Assert(0 <= nstr.Id && nstr.Id < editor.Values.Length);
Microsoft.ML.DataView (5)
VBuffer.cs (3)
270/// <param name="destination">The destination buffer. This <see cref="Span{T}.Length"/> must have least <see cref="Length"/>.</param> 279/// <param name="destination">The destination buffer. This <see cref="Span{T}.Length"/> must be at least <see cref="Length"/> 287Contracts.CheckParam(0 <= destinationIndex && destinationIndex <= destination.Length - Length,
VBufferEditor.cs (2)
136return new VBuffer<T>(_logicalLength, Values.Length, _values, _indices); 159Contracts.CheckParam(physicalValuesCount <= Values.Length, nameof(physicalValuesCount),
Microsoft.ML.ImageAnalytics (3)
ImageLoader.cs (3)
342if (bytesRead != srcSpan.Length) 345Contract.Assert(srcSpan.Length == dstSpan.Length);
Microsoft.ML.KMeansClustering (1)
KMeansModelParameters.cs (1)
167Host.Assert(distances.Length >= _k);
Microsoft.ML.StandardTrainers (5)
Standard\LogisticRegression\LogisticRegression.cs (1)
214Contracts.Assert(editor.Values.Length >= BiasCount && (grad.IsDense || editor.Indices[BiasCount - 1] == BiasCount - 1));
Standard\LogisticRegression\MulticlassLogisticRegression.cs (2)
272Contracts.Assert(editor.Values.Length >= BiasCount && (grad.IsDense || editor.Indices[BiasCount - 1] == BiasCount - 1)); 1241Host.Assert(dst.Length == NumberOfClasses);
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (1)
385Contracts.Assert(output.Length >= _numClasses);
Standard\PoissonRegression\PoissonRegression.cs (1)
179Contracts.Assert(editor.Values.Length >= BiasCount && (grad.IsDense || editor.Indices[BiasCount - 1] == BiasCount - 1));
Microsoft.ML.TestFrameworkCommon (1)
TestLogger.cs (1)
48if ((span.Length >= 2) && (span[count - 2] == '\r') && (span[count - 1] == '\n'))
Microsoft.ML.Tokenizers (132)
Model\BertTokenizer.cs (16)
347if (destination.Length < 1) 355if (destination.Length <= valuesWritten) 364if (destination.Length <= valuesWritten) 375if (destination.Length <= valuesWritten) 383if (destination.Length <= valuesWritten) 476if (destination.Length < 1) 484if (destination.Length <= valuesWritten) 492if (destination.Length <= valuesWritten) 503if (destination.Length <= valuesWritten) 511if (destination.Length <= valuesWritten) 524if (destination.Length <= valuesWritten) 536if (destination.Length <= valuesWritten) 613if (destination.Length < 2) 622if (destination.Length <= valuesWritten) 634if (destination.Length <= valuesWritten) 642if (destination.Length < valuesWritten)
Model\BPETokenizer.cs (9)
934if (buffer.Length == 0) 964if (sSpan.Length > buffer.Length) 1017if (specialTokenSpan.Length > buffer.Length) 1046if (current.Length < span.Length) 1062if (current.Length == utf8BytesConsumed) // encoding is complete 1065if (completeCharsWritten > buffer.Length) 1083incompleteUtf8BytesInBuffer = current.Length - utf8BytesConsumed; 1217if (ContinuingSubwordPrefix.Length + s.Length <= buffer.Length) 1237if (s.Length + EndOfWordSuffix.Length <= buffer.Length)
Model\CodeGenTokenizer.cs (19)
1136if (destinationMaxSize > token.Length) 1200if (destinationMaxSize > token.Length) 1379if (BeginningOfSentenceToken!.Length > buffer.Length) 1402if (EndOfSentenceToken!.Length > buffer.Length) 1425if (UnknownToken!.Length > buffer.Length) 1452if (specialTokenSpan.Length > buffer.Length) 1472if (current.Length < span.Length) 1488if (current.Length == utf8BytesConsumed) // encoding is complete 1491if (completeCharsWritten > buffer.Length) 1509incompleteUtf8BytesInBuffer = current.Length - utf8BytesConsumed; 1600if (text.Length == 0) 1605if (text.Length == 1) 1613BpeSymbol[] symbols = ArrayPool<BpeSymbol>.Shared.Rent(text.Length); 1617for (int i = 0; i < text.Length; i++) 1621next: i == text.Length - 1 ? -1 : i + 1, 1627for (int i = 1; i < text.Length; i++) 1659List<EncodedToken> result = new List<EncodedToken>(text.Length); 1661for (int index = 0; (uint)index < (uint)text.Length; index = symbols[index].next) 1682int endIndex = index + length < mapping.Length ? mapping[index + length] : originalText.Length;
Model\EnglishRobertaTokenizer.cs (5)
808if (s.Length > buffer.Length) 917Debug.Assert(index + tokens[i].Value.Length <= indexMapping.Length); 950if (token.Length == 0) 957if (token.Length == 1) 964List<string> word = new(token.Length);
Model\SentencePieceBaseModel.cs (6)
645if (buffer.Length < specialToken!.Length) 673if (charCount > buffer.Length) 690if (buffer.Length < 1) 722if (tokenSpan.Length > buffer.Length) 749if (tokenSpan.Length > buffer.Length) 770if (buffer.Length < token.Length - delta)
Model\SentencePieceBpeModel.cs (4)
229if (len > utf8Bytes.Length) 529if (len > utf8Bytes.Length) 792if (len > utf8Bytes.Length) 1068if (len > utf8Bytes.Length)
Model\SentencePieceUnigramModel.cs (12)
458if (text.Length > utf16NormalizedString.Length) 471if (Encoding.UTF8.GetMaxCharCount(normalizationSpan.Length) > normalizedUtf16Span.Length) 577Debug.Assert(normalizationSpan.Length >= (byteCount << 1)); 620BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1); 630int endsAt = normalizationSpan.Length; 753Debug.Assert(bestPathEndsAt.Length >= size + 1); 1071BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1); 1077int endsAt = normalizationSpan.Length; 1412BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1); 1422int endsAt = normalizationSpan.Length; 1673BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1); 1678int endsAt = normalizationSpan.Length;
Model\TiktokenTokenizer.cs (10)
328Debug.Assert(encodedLength < indexMappingSpan.Length); 445Debug.Assert(encodedLength < indexMappingSpan.Length); 610Debug.Assert(encodedLength < indexMappingSpan.Length); 736Debug.Assert(encodedLength < indexMappingSpan.Length); 819if ((uint)utf8ByteCount + (uint)tokenBytes.Length > (uint)utf8Bytes.Length) 841byte[] tmp = ArrayPool<byte>.Shared.Rent(Math.Max(utf8Bytes.Length * 2, requiredCapacity)); 893if (utf8BytesIncompleteCount + tokenBytes.Length > utf8Bytes.Length) 899if (Encoding.UTF8.GetMaxCharCount(utf8BytesIncompleteCount + tokenBytes.Length) > tempBuffer.Length) 917if (incompleteCharsWritten > buffer.Length) 950if (charsConsumed > buffer.Length)
Model\WordPieceTokenizer.cs (3)
755if (token.Length - ContinuingSubwordPrefix.Length > buffer.Length) 767if (token.Length + 1 > buffer.Length) 779if (token.Length > buffer.Length)
Normalizer\BertNormalizer.cs (2)
163if (index + chars.Length >= buffer.Length) 169index += chars.Length;
Normalizer\SentencePieceNormalizer.cs (8)
182if (span.Length < spanLength) 274Debug.Assert(bufferIndex < span.Length - 1); 307Debug.Assert(bufferIndex < span.Length); 484if (normalized.Length <= normalizedIndex + _spaceSymbol.Length) 496if (normalized.Length <= normalizedIndex + 1) 524int length = normalizedIndex - space.Length; 548if (normalized.Length <= normalizedIndex + _spaceSymbol.Length) 557if (normalized.Length <= normalizedIndex + 1)
Utils\BytePairEncoder.cs (9)
39for (int i = 0; i < byteIndicesAndRanks.Length; i++) 46if (startIndex + skip + 2 < byteIndicesAndRanks.Length) 58for (int i = 0; i < byteIndicesAndRanks.Length - 2; i++) 67while (byteIndicesAndRanks.Length > 1) 70for (int i = 0; i < byteIndicesAndRanks.Length - 1; i++) 88byteIndicesAndRanks = byteIndicesAndRanks.Slice(0, byteIndicesAndRanks.Length - 1); 96var result = new (int Id, int TokenIndex, int TokenLength)[byteIndicesAndRanks.Length - 1]; 232if (rightEnd < state.Length) 252while (currentIndex < state.Length)
Utils\DoubleArrayTrie.cs (2)
747if (encodingLength > bytes.Length) 1086if (numResults < results.Length)
Utils\Helpers.cs (9)
32Debug.Assert(span.Length <= newSize); 70Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 71Debug.Assert(indexMapping.Length >= destination.Length); 124Debug.Assert(destination.Length >= 4); 162Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 163Debug.Assert(indexMapping.Length >= destination.Length); 237Debug.Assert(utf16Chars.Length >= GetUtf16LengthFromUtf8Bytes(utf8Bytes));
Utils\OrdinalUtf8StringComparer.cs (2)
61if (requiredLength1 > buffer1.Length) 67if (requiredLength2 > buffer2.Length)
Utils\ValueStringBuilder.cs (16)
41Debug.Assert(value <= _chars.Length); 46public int Capacity => _chars.Length; 54if ((uint)capacity > (uint)_chars.Length) 231if (_pos > _chars.Length - count) 251if (_pos > (_chars.Length - count)) 271if ((uint)pos < (uint)chars.Length) 291if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 305if (pos > _chars.Length - s.Length) 320if (_pos > _chars.Length - count) 326for (int i = 0; i < dst.Length; i++) 336if (pos > _chars.Length - length) 342for (int i = 0; i < dst.Length; i++) 352if (pos > _chars.Length - value.Length) 365if (origPos > _chars.Length - length) 395Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 401Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
Microsoft.ML.Tokenizers.Tests (21)
BertTokenizerTests.cs (4)
401Assert.Equal(ids1Span.Length, written); 424Assert.Equal(ids1Span.Length, written); 441Assert.Equal(ids1Span.Length, written); 594Assert.Equal(ids1Span.Length, written);
LlamaTests.cs (3)
904if (sp.Length > 0 && sp[sp.Length - 1] == ' ') 906sp = sp.Slice(0, sp.Length - 1);
src\Microsoft.ML.Tokenizers\Utils\DoubleArrayTrie.cs (2)
747if (encodingLength > bytes.Length) 1086if (numResults < results.Length)
src\Microsoft.ML.Tokenizers\Utils\Helpers.cs (9)
32Debug.Assert(span.Length <= newSize); 70Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 71Debug.Assert(indexMapping.Length >= destination.Length); 124Debug.Assert(destination.Length >= 4); 162Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 163Debug.Assert(indexMapping.Length >= destination.Length); 237Debug.Assert(utf16Chars.Length >= GetUtf16LengthFromUtf8Bytes(utf8Bytes));
src\Microsoft.ML.Tokenizers\Utils\OrdinalUtf8StringComparer.cs (2)
61if (requiredLength1 > buffer1.Length) 67if (requiredLength2 > buffer2.Length)
TokenizerTests.cs (1)
86if (pos >= destination.Length)
Microsoft.ML.Transforms (6)
Dracula\CMCountTable.cs (1)
147Contracts.Assert(counts.Length == LabelCardinality);
Dracula\DictCountTable.cs (1)
118Contracts.Check(counts.Length == LabelCardinality);
Dracula\Featurizer.cs (4)
140_host.Assert(features.Length == NumFeatures); 173_host.Assert(_labelBinCount == counts.Length); 194_host.Assert(counts.Length == _labelBinCount); 195_host.Assert(logOdds.Length == _logOddsCount);
Microsoft.NET.Build.Containers (2)
Layer.cs (2)
160Debug.Assert(bytesWritten == uncompressedHash.Length); 168Debug.Assert(bW == hash.Length);
Microsoft.NET.Build.Tasks (4)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (4)
59span = span.Slice(utf8Bom.Length, span.Length - utf8Bom.Length); 82if (reader.BytesConsumed == span.Length) 84newSegmentSize = span.Length * 2; 87int remaining = (int)(span.Length - reader.BytesConsumed);
Microsoft.Net.Http.Headers (2)
HeaderUtilities.cs (2)
629var spanLength = span.Length; 700span[span.Length - 1] = span[0] = '\"';
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (4)
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (4)
329if (assets.Length <= 1) 334var seen = new HashSet<string>(assets.Length, OSPath.PathComparer); 336var tail = assets.Length - 1; 338for (var i = 0; i < assets.Length; i++)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (9)
Data\StaticWebAsset.cs (4)
329if (assets.Length <= 1) 334var seen = new HashSet<string>(assets.Length, OSPath.PathComparer); 336var tail = assets.Length - 1; 338for (var i = 0; i < assets.Length; i++)
DefineStaticWebAssets.Cache.cs (2)
93var values = new string[candidateAssetMetadata.Length + metadataOffset]; 97for (var j = 0; j < candidateAssetMetadata.Length; j++)
Utils\HashingUtils.cs (3)
19for (var i = 0; i < values.Length; i++) 36for (var i = 0; i < items.Length; i++) 40for (var j = 0; j < properties.Length; j++)
Microsoft.NET.Sdk.WorkloadManifestReader (4)
WorkloadManifestReader.SystemTextJson.cs (4)
59span = span.Slice(utf8Bom.Length, span.Length - utf8Bom.Length); 82if (reader.BytesConsumed == span.Length) 84newSegmentSize = span.Length * 2; 87int remaining = (int)(span.Length - reader.BytesConsumed);
Microsoft.Private.Windows.Core (89)
_generated\129\Windows.Win32.IDispatch.g.cs (2)
103 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 104 winmdroot.Foundation.HRESULT __result = this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\130\Windows.Win32.IDispatchEx.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 winmdroot.Foundation.HRESULT __result = this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\139\Windows.Win32.IEnumFORMATETC.g.cs (2)
63 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 74 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\141\Windows.Win32.IEnumSTATDATA.g.cs (2)
63 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 74 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\142\Windows.Win32.IEnumSTATSTG.g.cs (2)
63 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 74 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\143\Windows.Win32.IEnumString.g.cs (2)
63 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 74 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\156\Windows.Win32.IPictureDisp.g.cs (2)
86 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 87 winmdroot.Foundation.HRESULT __result = this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\159\Windows.Win32.ISequentialStream.g.cs (2)
63 winmdroot.Foundation.HRESULT __result = this.Read((void* )pvLocal, (uint )pv.Length, pcbReadLocal); 74 winmdroot.Foundation.HRESULT __result = this.Read((void* )pvLocal, (uint )pv.Length, default(uint* ));
_generated\162\Windows.Win32.IStream.g.cs (2)
63 winmdroot.Foundation.HRESULT __result = this.Read((void* )pvLocal, (uint )pv.Length, pcbReadLocal); 74 winmdroot.Foundation.HRESULT __result = this.Read((void* )pvLocal, (uint )pv.Length, default(uint* ));
_generated\164\Windows.Win32.ITypeInfo.g.cs (3)
145 winmdroot.Foundation.HRESULT __result = this.GetNames(memid, rgBstrNamesLocal, (uint )rgBstrNames.Length, pcNamesLocal); 227 if (!rgszNames.IsEmpty && !pMemId.IsEmpty && rgszNames.Length != pMemId.Length) throw new ArgumentException(); 228 winmdroot.Foundation.HRESULT __result = this.GetIDsOfNames(rgszNamesLocal, (uint )(pMemId.IsEmpty ? rgszNames.Length : pMemId.Length), pMemIdLocal);
_generated\199\Windows.Win32.PInvokeCore.GDI32.dll.g.cs (4)
448 uint __result = PInvokeCore.GetEnhMetaFileBits(hEMF, (uint )lpData.Length, (byte* )lpDataLocal); 474 int __result = PInvokeCore.GetObject(h, pv.Length, (void* )pvLocal); 510 uint __result = PInvokeCore.GetPaletteEntries(hpal, iStart, (uint )pPalEntries.Length, pPalEntriesLocal); 537 uint __result = PInvokeCore.GetRegionData(hrgn, (uint )lpRgnData.Length, (winmdroot.Graphics.Gdi.RGNDATA* )lpRgnDataLocal);
_generated\201\Windows.Win32.PInvokeCore.KERNEL32.dll.g.cs (1)
191 int __result = PInvokeCore.MultiByteToWideChar(CodePage, dwFlags, new winmdroot.Foundation.PCSTR (lpMultiByteStrLocal), cbMultiByte, lpWideCharStrLocal, lpWideCharStr.Length);
_generated\204\Windows.Win32.PInvokeCore.SHELL32.dll.g.cs (1)
46 uint __result = PInvokeCore.DragQueryFile(hDrop, iFile, lpszFileLocal, (uint )lpszFile.Length);
_generated\205\Windows.Win32.PInvokeCore.USER32.dll.g.cs (2)
363 int __result = PInvokeCore.GetClipboardFormatName(format, lpszFormatNameLocal, lpszFormatName.Length); 610 int __result = PInvokeCore.GetWindowText(hWnd, lpStringLocal, lpString.Length);
_generated\238\Windows.Win32.System_Com_IEnumFORMATETC_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\240\Windows.Win32.System_Com_IEnumSTATDATA_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\241\Windows.Win32.System_Com_IEnumString_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\248\Windows.Win32.System_Com_ISequentialStream_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Read((void* )pvLocal, (uint )pv.Length, pcbReadLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Read((void* )pvLocal, (uint )pv.Length, default(uint* ));
_generated\250\Windows.Win32.System_Com_IStream_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Read((void* )pvLocal, (uint )pv.Length, pcbReadLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Read((void* )pvLocal, (uint )pv.Length, default(uint* ));
_generated\252\Windows.Win32.System_Com_ITypeInfo_Extensions.g.cs (3)
61 winmdroot.Foundation.HRESULT __result = @this.GetNames(memid, rgBstrNamesLocal, (uint )rgBstrNames.Length, pcNamesLocal); 95 if (!rgszNames.IsEmpty && !pMemId.IsEmpty && rgszNames.Length != pMemId.Length) throw new ArgumentException(); 96 winmdroot.Foundation.HRESULT __result = @this.GetIDsOfNames(rgszNamesLocal, (uint )(pMemId.IsEmpty ? rgszNames.Length : pMemId.Length), pMemIdLocal);
_generated\254\Windows.Win32.System_Com_StructuredStorage_IEnumSTATSTG_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\DecimalExtensions.cs (1)
19if (destination.Length <= 3)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\BinaryReaderExtensions.cs (2)
26byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 29int numRead = reader.Read(sharedBuffer, 0, buffer.Length);
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\StreamExtensions.cs (4)
31byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 34int numRead = stream.Read(sharedBuffer, 0, buffer.Length); 35if ((uint)numRead > (uint)buffer.Length) 85while (totalRead < buffer.Length)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\StringExtensions.cs (1)
20if (destination.Length < stringValue.Length)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\Text\EncodingExtensions.cs (1)
26return encoding.GetBytes(sourcePointer, source.Length, destinationPointer, destination.Length);
System\BufferScope.cs (3)
59if (initialBuffer.Length >= minimumLength) 83if (_span!.Length >= capacity) 111public readonly int Length => _span.Length;
System\IO\BinaryReaderExtensions.cs (1)
124if (reader.Read(arrayData) != arrayData.Length)
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
324uint charactersCopied = PInvokeCore.DragQueryFile(hdrop, i, buffer, (uint)fileName.Length);
System\SpanHelpers.cs (2)
17if (source.Length >= destination.Length) 19source = source[..(destination.Length - 1)];
System\SpanWriter.cs (11)
16readonly get => Span.Length - _unwritten.Length; 20public readonly int Length => Span.Length; 46if (_unwritten.Length >= values.Length) 63if (_unwritten.Length >= count) 82public void Rewind(int count) => _unwritten = Span[(Span.Length - _unwritten.Length - count)..]; 92Debug.Assert((uint)count <= (uint)_unwritten.Length); 93UncheckedSlice(ref _unwritten, count, _unwritten.Length - count); 99Debug.Assert((uint)start <= (uint)span.Length && (uint)length <= (uint)(span.Length - start));
System\Text\ValueStringBuilder.cs (15)
52Debug.Assert(value <= _chars.Length); 57public readonly int Capacity => _chars.Length; 65if ((uint)capacity > (uint)_chars.Length) 155if (_pos > _chars.Length - count) 175if (_pos > (_chars.Length - count)) 190if ((uint)pos < (uint)_chars.Length) 216if (s.Length == 1 && (uint)pos < (uint)_chars.Length) 231if (pos > _chars.Length - s.Length) 260if (_pos > _chars.Length - count) 266for (int i = 0; i < dst.Length; i++) 277if (pos > _chars.Length - length) 283for (int i = 0; i < dst.Length; i++) 294if (pos > _chars.Length - value.Length) 322Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 330Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
Windows\Win32\Graphics\Gdi\ArgbBuffer.cs (2)
29public ArgbBuffer(Span<Color> colors) : this(colors.Length) 31for (int i = 0; i < colors.Length; i++)
Windows\Win32\PInvokeCore.GetPaletteEntries.cs (1)
13return GetPaletteEntries(hpal, 0, (uint)entries.Length, entry);
Microsoft.Win32.Registry (8)
Microsoft\Win32\RegistryKey.cs (7)
771int nameLength = nameSpan.Length; 793nameLength = nameSpan.Length; 1017int dataLength = span.Length; 1036dataLength = span.Length * 2; 1078Debug.Assert((uint)dataLength <= span.Length, $"Expected {dataLength} <= {span.Length}"); 1108if (dataLength >= span.Length)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
47int length = FormatMessage(flags, moduleHandle, unchecked((uint)errorCode), 0, bufferPtr, stackBuffer.Length, IntPtr.Zero);
PresentationCore (8)
System\Windows\Input\TextCompositionManager.cs (2)
407ptrMultiByte, multiByte.Length, ptrOutputChars, outputChars.Length); 857Debug.Assert(destination.Length == 2, "Invalid buffer length");
System\Windows\Media\ColorTransform.cs (6)
101for (int i = 0; i < dstValue.Length; i++) 132if (srcValue.Length < 3 || srcValue.Length > 8) 137if (srcValue.Length <= 4) 141for (int i = 0; i < srcValue.Length; i++) 163for (int i = 0; i < srcValue.Length; i++)
PresentationFramework (3)
MS\Internal\PtsHost\ListMarkerSourceInfo.cs (2)
191result[result.Length - 1] = NumberSuffix; 192for (int i = result.Length - 2; i >= 0; --i)
System\Windows\Documents\FixedSOMTextRun.cs (1)
156for (int i = 0; i < destination.Length; i++)
ReachFramework (1)
Serialization\XpsFontSubsetter.cs (1)
683for (int i = 0; i < guidByteArray.Length; i++)
Roslyn.Diagnostics.Analyzers (19)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (5)
208if (destination.Length < HashLengthInBytes) 233if (destination.Length < HashLengthInBytes) 270if (destination.Length < HashLengthInBytes) 295if (destination.Length < HashLengthInBytes) 329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (1)
108if (destination.Length >= sizeof(ulong) * 2)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (2)
333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 336state.BufferedCount = (uint)remaining.Length;
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (6)
694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 727Debug.Assert(keys.Length == values.Length); 738Debug.Assert(values.Length == keys.Length); 978Debug.Assert(values.Length == keys.Length); 1252if ((uint)i < (uint)values.Length) // check to see if we have values
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
40if (bitArrayIndex < (uint)span.Length) 55bitArrayIndex < (uint)span.Length &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (3)
175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 184if (charsWritten == tempBuffer.Length) 200int destLength = bytes.Length;
Shared (3)
ServerSentEvents\Helpers.cs (3)
35Debug.Assert(buffer.Length >= MaxDecimalDigits); 53Debug.Assert(value.Length <= buffer.Length); 67Debug.Assert(maxByteCount <= buffer.Length);
System.Collections (1)
src\runtime\src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (1)
30if (bitArrayIndex < (uint)span.Length)
System.Collections.Immutable (15)
System\Collections\Frozen\FrozenDictionary.cs (1)
385if (destination.Length < Count)
System\Collections\Frozen\FrozenHashTable.cs (7)
60if ((long)numBuckets + hashCodes.Length > Array.MaxLength) 65int[] arrayPoolBuckets = ArrayPool<int>.Shared.Rent(numBuckets + hashCodes.Length); 67Span<int> nexts = arrayPoolBuckets.AsSpan(numBuckets, hashCodes.Length); 74for (int index = 0; index < hashCodes.Length; index++) 77int bucketNum = (int)HashHelpers.FastMod((uint)hashCode, (uint)bucketStarts.Length, fastModMultiplier); 90var hashtableHashcodes = new int[hashCodes.Length]; 91var hashtableBuckets = new Bucket[bucketStarts.Length];
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (1)
40for (int srcIndex = 0; srcIndex < hashCodes.Length; srcIndex++)
System\Collections\Frozen\ItemsFrozenSet.cs (1)
35for (int srcIndex = 0; srcIndex < hashCodes.Length; srcIndex++)
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (1)
37for (int srcIndex = 0; srcIndex < hashCodes.Length; srcIndex++)
System\Collections\Frozen\String\OrdinalStringFrozenDictionary.cs (1)
52for (int srcIndex = 0; srcIndex < hashCodes.Length; srcIndex++)
System\Collections\Frozen\String\OrdinalStringFrozenSet.cs (1)
43for (int srcIndex = 0; srcIndex < hashCodes.Length; srcIndex++)
System\Collections\Immutable\ImmutableArray_1.Builder.cs (1)
1020Requires.Range(this.Count <= destination.Length, nameof(destination));
System\Collections\Immutable\ImmutableArray_1.cs (1)
916Requires.Range(self.Length <= destination.Length, nameof(destination));
System.Collections.Specialized (2)
System\Collections\Specialized\BitVector32.cs (2)
166dst[dst.Length - 1] = '}'; 170for (int i = 0; i < dst.Length; i++)
System.Console (22)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\ConsolePal.Unix.cs (6)
523Debug.Assert(readBytesPos > 0 && readBytesPos <= readBytes.Length); 580if (dstPos == dst.Length) 582var tmpReadBytes = new byte[dst.Length * 2]; 615Debug.Assert(foundByteDstPos < foundByteDst.Length, "Should only be called when there's room for at least one byte."); 952int result = Interop.CheckIo(Interop.Sys.Read(fd, bufPtr, buffer.Length)); 953Debug.Assert(result <= buffer.Length);
System\IO\CachedConsoleStream.cs (1)
65if (lastNewLine + 1 < charBuffer.Length)
System\IO\StdInReader.cs (1)
77if (spaceRemaining < chars.Length)
System.Data.Common (8)
System\Data\SQLTypes\SQLBytes.cs (1)
326int count = Math.Min(buffer.Length, (int)(Length - offset));
System\Data\SQLTypes\SQLDecimal.cs (7)
1172ArgumentOutOfRangeException.ThrowIfLessThan(destination.Length, 4, nameof(destination)); 1866Debug.Assert(rgulData.Length == s_cNumeMax, "rgulData.Length == x_cNumeMax", "Invalid array length"); 1940Debug.Assert(rglData.Length == 4, "rglData.Length == 4", $"Wrong array length: {rglData.Length}"); 2472Debug.Assert(rgulD.Length >= ciulS, "rgulD.Length >= ciulS", "Invalid array length"); 2544Debug.Assert(rgulU.Length == s_cNumeMax); 2613Debug.Assert(rgulD.Length == s_cNumeMax);
System.Diagnostics.DiagnosticSource (28)
src\runtime\src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (1)
129_maxIndex = bitMap.Length * sizeof(ulong) * 8;
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Diagnostics\Activity.cs (5)
2116Debug.Assert(outBytes.Length == 16 || outBytes.Length == 8); 2121if (outBytes.Length == 16) 2133Debug.Assert(outBytes.Length * 2 == charData.Length); 2134for (int i = 0; i < outBytes.Length; i++)
System\Diagnostics\Metrics\AggregatorStore.cs (1)
502KeyValuePair<string, string>[] labels = new KeyValuePair<string, string>[indexedNames.Length];
System\Diagnostics\Metrics\TagList.netcore.cs (1)
143if (tags.Length < _tagsCount)
System.Diagnostics.FileVersionInfo (5)
System\Diagnostics\FileVersionInfo.Unix.cs (5)
207if (parts.Length <= 4 && parts.Length > 0) 210if (!endedEarly && parts.Length > 1) 213if (!endedEarly && parts.Length > 2) 216if (!endedEarly && parts.Length > 3)
System.Diagnostics.PerformanceCounter (2)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
47int length = FormatMessage(flags, moduleHandle, unchecked((uint)errorCode), 0, bufferPtr, stackBuffer.Length, IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.GetComputerName.cs (1)
21uint length = (uint)buffer.Length;
System.Diagnostics.Process (24)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetGroupList.cs (2)
23int ngroups = groups.Length; 33else if (rv == -1 && ngroups > groups.Length)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (3)
43int resultLength = ReadLink(path, ref MemoryMarshal.GetReference(spanBuffer), spanBuffer.Length); 51else if (resultLength < spanBuffer.Length) 71arrayBuffer = ArrayPool<byte>.Shared.Rent(spanBuffer.Length * 2);
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (2)
41if ((long)MaxUtf8BytesPerChar * managed.Length >= buffer.Length) 45if (exactByteCount > buffer.Length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Diagnostics\Process.Linux.cs (3)
230if (bytesRead == buffer.Length) 232uint newLength = (uint)buffer.Length * 2; 244Debug.Assert(bytesRead < buffer.Length);
System.Diagnostics.TextWriterTraceListener (1)
System\Diagnostics\XmlWriterTraceListener.cs (1)
411Debug.Assert(charsWritten == span.Length);
System.DirectoryServices.Protocols (7)
System\DirectoryServices\Protocols\common\DirectoryControl.cs (7)
171ThrowUnless(bytesConsumed == asnSpan.Length); 194ThrowUnless(bytesConsumed == asnSpan.Length); 209ThrowUnless(bytesConsumed == asnSpan.Length); 221ThrowUnless(asnSpan.Length == bytesConsumed); 234ThrowUnless(bytesConsumed == asnSpan.Length); 246if (asnSpan.Length <= AttributeNameStackAllocationThreshold) 275ThrowUnless(bytesConsumed == asnSpan.Length);
System.Drawing.Common (14)
System\Drawing\Drawing2D\GraphicsPath.cs (2)
974PInvokeGdiPlus.GdipGetPathTypes(_nativePath, t, destination.Length).ThrowIfFailed(); 1019PInvokeGdiPlus.GdipGetPathPoints(_nativePath, (GdiPlus.PointF*)p, destination.Length).ThrowIfFailed();
System\Drawing\Drawing2D\GraphicsPathIterator.cs (8)
162if (points.Length != types.Length 163|| points.Length < Count) 168if (points.Length == 0) 182points.Length).ThrowIfFailed(); 211if ((points.Length != types.Length) 215|| count > points.Length
System\Drawing\Drawing2D\Matrix.cs (1)
147Debug.Assert(elements.Length >= 6);
System\Drawing\FontFamily.cs (1)
238Debug.Assert(span.Length == (int)PInvokeCore.LF_FACESIZE);
System\Drawing\Imaging\EncoderParameters.cs (2)
43EncoderParameters parameters = new(nativeParameters.Length); 44for (int i = 0; i < nativeParameters.Length; i++)
System.Formats.Asn1 (26)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (2)
57Return(_skipClear ? 0 : Span.Length); 114if (currentBuffer.Length >= length)
System\Formats\Asn1\Asn1Tag.cs (3)
301/// <see langword="false"/> if <paramref name="destination"/>.<see cref="Span{T}.Length"/> &lt; 308if (destination.Length < spaceRequired) 360/// <paramref name="destination"/>.<see cref="Span{T}.Length"/> &lt; <see cref="CalculateEncodedSize"/>.
System\Formats\Asn1\AsnCharacterStringEncodings.net.cs (6)
42int available = write ? Math.Min(chars.Length, bytes.Length) : chars.Length; 77int available = write ? Math.Min(bytes.Length, chars.Length) : bytes.Length; 283int available = write ? Math.Min(chars.Length, bytes.Length) : chars.Length; 322int available = write ? Math.Min(bytes.Length, chars.Length) : bytes.Length; 487int available = write ? Math.Min(chars.Length, bytes.Length / sizeof(ushort)) : chars.Length; 524int available = write ? Math.Min(sourceLength, chars.Length) : sourceLength;
System\Formats\Asn1\AsnDecoder.BitString.cs (2)
189if (value.Length > destination.Length) 609if (dest.Length < contentLength)
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (1)
395for (int byteIdx = 0; byteIdx < value.Length; byteIdx++)
System\Formats\Asn1\AsnDecoder.OctetString.cs (5)
86if (contents.Length > destination.Length) 464if (dest.Length < contentLength) 506if (tmpSpace.Length > 0 && tooBig > tmpSpace.Length) 512if (tooBig > tmpSpace.Length)
System\Formats\Asn1\AsnDecoder.Oid.cs (2)
199Debug.Assert(writeSpan.Length >= SemanticByteCount); 212int bytesWritten = tmpBytes.Length - writeSpan.Length;
System\Formats\Asn1\AsnDecoder.Text.cs (1)
352if (contents.Length > destination.Length)
System\Formats\Asn1\AsnWriter.cs (1)
144if (destination.Length < _offset)
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (2)
103int totalLength = IntegerPortionLength + 1 + fraction.Length; 138_offset += fraction.Length;
System\Formats\Asn1\AsnWriter.Oid.cs (1)
190Debug.Assert(dest.Length > 0);
System.Formats.Cbor (6)
System\Formats\Cbor\Reader\CborReader.String.cs (4)
80if (length > destination.Length) 242if (charLength > destination.Length) 357if (concatenatedBufferSize > destination.Length) 426if (concatenatedStringSize > destination.Length)
System\Formats\Cbor\Writer\CborWriter.cs (2)
238if (encoding.Length > destination.Length) 256if (encoding.Length > destination.Length)
System.Formats.Nrbf (1)
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (1)
134int sliceSize = Math.Min(valuesToRead.Length, MaxChunkLength);
System.Formats.Tar (27)
src\runtime\src\libraries\Common\src\System\IO\SubReadStream.cs (1)
195destination = destination[..LimitByRemaining(destination.Length)];
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Formats\Tar\GnuSparseStream.cs (1)
173int toRead = (int)Math.Min(destination.Length, _realSize - _virtualPosition);
System\Formats\Tar\TarHeader.Write.cs (11)
856if (span.Length < length) 938int i = destination.Length - 3; 939int j = converted.Length - 2; // Skip the null terminator in 'converted' 961Debug.Assert(destination.Length > 1); 964int numToCopy = Math.Min(bytesToWrite.Length, destination.Length); 975Debug.Assert(destination.Length > 1); 981int numToCopy = Math.Min(bytesToWrite.Length, destination.Length - 1); 983int copyPos = destination.Length - 1 - bytesToWrite.Length; 1035Debug.Assert(destination.Length == 8, "8 byte field expected."); 1060Debug.Assert(destination.Length == 12, "12 byte field expected."); 1089int i = digits.Length - 1;
System.IO.Compression (50)
src\runtime\src\libraries\Common\src\System\IO\SubReadStream.cs (1)
195destination = destination[..LimitByRemaining(destination.Length)];
System\IO\Compression\DeflateDecoder.cs (2)
85_state.AvailOut = (uint)destination.Length; 90bytesWritten = destination.Length - (int)_state.AvailOut;
System\IO\Compression\DeflateEncoder.cs (4)
208_state.AvailOut = (uint)destination.Length; 213bytesWritten = destination.Length - (int)_state.AvailOut; 264_state.AvailOut = (uint)destination.Length; 268bytesWritten = destination.Length - (int)_state.AvailOut;
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (3)
105int initialLength = buffer.Length; 113if (buffer.Length == 0) 140return initialLength - buffer.Length;
System\IO\Compression\DeflateManaged\InflaterManaged.cs (1)
121bytes = bytes.Slice(0, (int)Math.Min(bytes.Length, _uncompressedSize - _currentInflatedCount));
System\IO\Compression\DeflateManaged\OutputWindow.cs (6)
125if (output.Length > _bytesUsed) 133copy_end = (_end - _bytesUsed + output.Length) & WindowMask; // copy length of bytes 136int copied = output.Length; 138int tailLen = output.Length - copy_end; 146_window.AsSpan(copy_end - output.Length, output.Length).CopyTo(output);
System\IO\Compression\DeflateZLib\Inflater.cs (2)
72if (destination.Length == 0) 77return InflateVerified(bufPtr, destination.Length);
System\IO\Compression\WinZipAesStream.cs (4)
287int bytesToProcess = Math.Min(buffer.Length, keystreamAvailable); 327Debug.Assert(dest.Length <= src.Length); 329for (int i = 0; i < dest.Length; i++) 397int bytesToRead = GetBytesToRead(buffer.Length);
System\IO\Compression\ZipBlocks.cs (7)
485int bytesRead = stream.ReadAtLeast(blockContents, blockContents.Length, throwOnEndOfStream: false); 564int bytesRead = stream.ReadAtLeast(blockContents, blockContents.Length, throwOnEndOfStream: false); 673Debug.Assert(blockBytes.Length == FieldLengths.FilenameLength + FieldLengths.ExtraFieldLength); 708int bytesRead = stream.ReadAtLeast(blockBytes, blockBytes.Length, throwOnEndOfStream: false); 713bytesRead = stream.ReadAtLeast(blockBytes, blockBytes.Length, throwOnEndOfStream: false); 1030Debug.Assert(bytesToRead == collatedHeader[remainingBufferLength..].Length); 1170int bytesRead = stream.ReadAtLeast(blockContents, blockContents.Length, throwOnEndOfStream: false);
System\IO\Compression\ZipCryptoStream.cs (2)
149Debug.Assert(header.Length == 12); 166for (int i = 0; i < header.Length; i++)
System\IO\Compression\ZipCustomStreams.cs (1)
578if (buffer.Length > 0)
System\IO\Compression\ZipHelper.cs (9)
119if (maxBytesToRead - totalBytesRead + overlap < bufferSpan.Length) 127outOfBytes = bytesRead < bufferSpan.Length; 128if (bytesRead < bufferSpan.Length) 134Debug.Assert(bufferPointer < bufferSpan.Length); 169if (stream.Position >= buffer.Length) 171Debug.Assert(overlap <= buffer.Length); 172stream.Seek(-(buffer.Length - overlap), SeekOrigin.Current); 173bytesRead = stream.ReadAtLeast(buffer, buffer.Length, throwOnEndOfStream: true); 174stream.Seek(-buffer.Length, SeekOrigin.Current);
System\IO\Compression\Zstandard\ZstandardDecoder.cs (3)
201size = (nuint)destination.Length, 296destPtr, (nuint)destination.Length, 341dctx, destPtr, (nuint)destination.Length,
System\IO\Compression\Zstandard\ZstandardDictionary.cs (1)
110Debug.Assert(lengthsAsNuint.Length == sampleLengths.Length);
System\IO\Compression\Zstandard\ZstandardEncoder.cs (2)
253size = (nuint)destination.Length, 376nuint result = Interop.Zstd.ZSTD_compress2(ctx, outBytes, (nuint)destination.Length, inBytes, (nuint)source.Length);
System\IO\Compression\Zstandard\ZstandardStream.Decompress.cs (2)
106(status == OperationStatus.DestinationTooSmall && destination.IsEmpty && _buffer.ActiveLength == 0), $"{nameof(status)} == {status}, {nameof(destination.Length)} == {destination.Length}");
System.IO.Compression.Brotli (15)
System\IO\Compression\dec\BrotliDecoder.cs (6)
64nuint availableOutput = (nuint)destination.Length; 83Debug.Assert(availableOutput <= (nuint)destination.Length); 86bytesWritten += destination.Length - (int)availableOutput; 97destination = destination.Slice(destination.Length - (int)availableOutput); 119nuint availableOutput = (nuint)destination.Length; 122Debug.Assert(success ? availableOutput <= (nuint)destination.Length : availableOutput == 0);
System\IO\Compression\dec\BrotliStream.Decompress.cs (2)
245(lastResult == OperationStatus.DestinationTooSmall && destination.IsEmpty && _bufferCount == 0), $"{nameof(lastResult)} == {lastResult}, {nameof(destination.Length)} == {destination.Length}");
System\IO\Compression\enc\BrotliEncoder.cs (7)
149nuint availableOutput = (nuint)destination.Length; 167Debug.Assert(availableOutput <= (nuint)destination.Length); 170bytesWritten += destination.Length - (int)availableOutput; 173if ((int)availableOutput == destination.Length && Interop.Brotli.BrotliEncoderHasMoreOutput(_state) == Interop.BOOL.FALSE && availableInput == 0) 179destination = destination.Slice(destination.Length - (int)availableOutput); 217nuint availableOutput = (nuint)destination.Length; 220Debug.Assert(success ? availableOutput <= (nuint)destination.Length : availableOutput == 0);
System.IO.FileSystem.AccessControl (15)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
47int length = FormatMessage(flags, moduleHandle, unchecked((uint)errorCode), 0, bufferPtr, stackBuffer.Length, IntPtr.Zero);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System.IO.FileSystem.Watcher (14)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System.IO.Hashing (19)
System\IO\Hashing\Adler32.cs (2)
145if (destination.Length < Size) 167if (destination.Length < Size)
System\IO\Hashing\Crc32.cs (2)
230if (destination.Length < Size) 276if (destination.Length < Size)
System\IO\Hashing\Crc64.cs (2)
239if (destination.Length < Size) 285if (destination.Length < Size)
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (5)
160if (destination.Length < HashLengthInBytes) 185if (destination.Length < HashLengthInBytes) 222if (destination.Length < HashLengthInBytes) 247if (destination.Length < HashLengthInBytes) 281Debug.Assert(destination.Length == HashLengthInBytes);
System\IO\Hashing\XxHash128.cs (1)
104if (destination.Length >= sizeof(ulong) * 2)
System\IO\Hashing\XxHash3.cs (1)
104if (destination.Length >= sizeof(long))
System\IO\Hashing\XxHash32.cs (2)
214if (destination.Length < HashSize) 237if (destination.Length < HashSize)
System\IO\Hashing\XxHash64.cs (2)
214if (destination.Length < HashSize) 237if (destination.Length < HashSize)
System\IO\Hashing\XxHashShared.cs (2)
325Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 328state.BufferedCount = (uint)remaining.Length;
System.IO.Packaging (2)
System\IO\Packaging\InterleavedZipPackagePartStream.cs (2)
93if (buffer.Length == 0) 129while (totalBytesRead < buffer.Length)
System.IO.Pipelines (2)
System\IO\Pipelines\Pipe.cs (1)
1215int writable = Math.Min(destination.Length, source.Length);
System\IO\Pipelines\PipeReaderStream.cs (1)
126int actual = (int)Math.Min(bufferLength, buffer.Length);
System.IO.Pipes (1)
System\IO\Pipes\PipeStream.Unix.cs (1)
261if (buffer.Length == 0)
System.IO.Ports (1)
System\IO\Ports\SerialStream.Unix.cs (1)
784int numBytes = Interop.Serial.Read(_handle, bufPtr, buff.Length);
System.Linq (18)
System\Linq\OrderedEnumerable.SpeedOpt.cs (1)
48for (int i = 0; i < destination.Length; i++)
System\Linq\Range.cs (2)
82destination.Length >= Vector<T>.Count) 87while (destination.Length >= Vector<T>.Count)
System\Linq\SegmentedArrayBuilder.cs (6)
107if ((uint)countInCurrentSegment < (uint)currentSegment.Length) 144int availableSpaceInCurrentSpan = _currentSegment.Length - _countInCurrentSegment; 162bool currentSegmentIsScratchBufferWithRemainingSpace = _segmentsCount == 0 && _countInCurrentSegment < _currentSegment.Length; 169int remainingSpaceInCurrentSegment = _currentSegment.Length - _countInCurrentSegment; 219if ((uint)countInCurrentSegment < (uint)currentSegment.Length) 342int currentSegmentLength = _currentSegment.Length;
System\Linq\Select.SpeedOpt.cs (6)
166for (int i = 0; i < destination.Length; i++) 309for (int i = 0; i < results.Length; i++, start++) 422for (int i = 0; i < destination.Length; i++) 540for (int i = 0; i < results.Length; i++) 815Debug.Assert(index == results.Length, "All list elements were not initialized."); 983for (int i = 0; i < destination.Length; i++, sourceIndex++)
System\Linq\SingleLinkedNode.cs (1)
119int index = span.Length;
System\Linq\SkipTake.SpeedOpt.cs (2)
153sourceSpan.Slice(sourceIndex, destination.Length).CopyTo(destination); 159for (int i = 0; i < destination.Length; i++, sourceIndex++)
System.Linq.AsyncEnumerable (1)
System\Linq\SingleLinkedNode.cs (1)
119int index = span.Length;
System.Memory (15)
System\Buffers\BuffersExtensions.cs (4)
68if (span.Length > destination.Length) 80if (sequence.Length > destination.Length) 121if (value.Length <= destination.Length) 137int writeSize = Math.Min(destination.Length, input.Length);
System\Buffers\ReadOnlySequenceStream.cs (1)
82int n = (int)Math.Min(remaining.Length, buffer.Length);
System\Buffers\SequenceReader.cs (6)
417if (firstSpan.Length >= destination.Length) 419firstSpan.Slice(0, destination.Length).CopyTo(destination); 430if (Remaining < destination.Length) 434Debug.Assert(firstSpan.Length < destination.Length); 444int toCopy = Math.Min(nextSpan.Length, destination.Length - copied); 447if (copied >= destination.Length)
System\Text\EncodingExtensions.cs (4)
116int originalBytesLength = bytes.Length; 130return originalBytesLength - bytes.Length; // total number of bytes we wrote 307int originalCharsLength = chars.Length; 321return originalCharsLength - chars.Length; // total number of chars we wrote
System.Net.Http (109)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (19)
34if (destination.Length != 0) 90if ((uint)destination.Length >= 2) 122if ((uint)destination.Length >= 2) 154if ((uint)destination.Length >= 2) 192if ((uint)destination.Length != 0) 272if ((uint)destination.Length >= 3) 305if ((uint)destination.Length >= 3) 344if ((uint)destination.Length >= 2) 371if (destination.Length != 0) 379if (value.Length <= destination.Length) 397Debug.Assert(destination.Length >= value.Length); 421if (destination.Length != 0) 429if (value.Length <= destination.Length) 460if (destination.Length != 0) 472if (encodedStringLength <= destination.Length) 503if (destination.Length != 0) 526if (destination.Length != 0) 553if (destination.Length >= valueLength) 639span = new byte[span.Length * 2];
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs (5)
680Debug.Assert(dst.Length > 0); 712if (j == dst.Length) 714Array.Resize(ref dstArray, dst.Length * 2); 779if (j == dst.Length) 781Array.Resize(ref dstArray, dst.Length * 2);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs (3)
28if (destination.Length == 0) 47if (1 == destination.Length) 60if (i >= destination.Length)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs (1)
45if (buffer.Length != 0)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (1)
154if (buffer.Length != 0)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (8)
69if (destination.Length >= 2) 184if (buffer.Length != 0) 195if (buffer.Length >= encodedStringLength) 233if (buffer.Length > 0) 258if (buffer.Length >= valueLength) 303Debug.Assert(buffer.Length >= s.Length); 320if (buffer.Length != 0) 328if (buffer.Length >= s.Length)
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
387if (destination.Length < _length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Net\Http\HttpContent.cs (6)
1013Debug.Assert(remainingInCurrentBuffer.Length < buffer.Length); 1014buffer.Slice(0, remainingInCurrentBuffer.Length).CopyTo(remainingInCurrentBuffer); 1015buffer = buffer.Slice(remainingInCurrentBuffer.Length); 1055Debug.Assert(destination.Length >= _totalLength); 1068Debug.Assert(destination.Length >= buffer.Length); 1076Debug.Assert(_lastBufferOffset <= destination.Length);
System\Net\Http\MultipartContent.cs (1)
482if (buffer.Length == 0)
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (10)
37if (buffer.Length == 0) 64buffer.Length >= _connection.ReadBufferSize && 72Debug.Assert(buffer.Length != 0); 73int bytesRead = _connection.Read(buffer.Slice(0, (int)Math.Min((ulong)buffer.Length, _chunkBytesRemaining))); 86if (buffer.Length == 0) 101if (buffer.Length == 0) 296Debug.Assert(buffer.Length > 0); 298while (buffer.Length > 0) 300if (ReadChunkFromConnectionBuffer(buffer.Length, cancellationRegistration) is not ReadOnlyMemory<byte> bytesRead || bytesRead.Length == 0) 305Debug.Assert(bytesRead.Length <= buffer.Length);
System\Net\Http\SocketsHttpHandler\ConnectionCloseReadStream.cs (1)
28if (bytesRead == 0 && buffer.Length != 0)
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (2)
32if ((ulong)buffer.Length > _contentBytesRemaining) 38if (bytesRead <= 0 && buffer.Length != 0)
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (1)
388if (buffer.Length != 0)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (2)
1749Debug.Assert(span.Length == 0); 2025Debug.Assert(destination.Length >= Size);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (2)
1116int bytesRead = Math.Min(buffer.Length, activeBuffer.Length); 1153else if (buffer.Length != 0)
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (4)
1217int copyLen = (int)Math.Min(buffer.Length, Math.Min(_responseDataPayloadRemaining, _recvBuffer.ActiveLength)); 1237int copyLen = (int)Math.Min(buffer.Length, _responseDataPayloadRemaining); 1240if (bytesRead == 0 && buffer.Length != 0) 1254while (buffer.Length != 0);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (21)
1044int length = (uint)carriageReturnIndex < (uint)buffer.Length && buffer[carriageReturnIndex] == '\r' 1053if (_allowedReadLineBytes <= buffer.Length) 1068if (line.Length < MinStatusLineLength || line[8] != ' ') 1104if (line.Length == MinStatusLineLength) 1140int bytesScanned = finished ? bytesConsumed : buffer.Length; 1155int originalBufferLength = buffer.Length; 1162return (finished: false, bytesConsumed: originalBufferLength - buffer.Length); 1169return (finished: true, bytesConsumed: originalBufferLength - buffer.Length + colIdx + 1); 1176if ((uint)valueStartIdx >= (uint)buffer.Length) 1178return (finished: false, bytesConsumed: originalBufferLength - buffer.Length); 1188if ((uint)lfIdx >= (uint)valueIterator.Length) 1190return (finished: false, bytesConsumed: originalBufferLength - buffer.Length); 1194int crOrLfIdx = (uint)crIdx < (uint)valueIterator.Length && valueIterator[crIdx] == '\r' 1199if ((uint)spIdx >= (uint)valueIterator.Length) 1201return (finished: false, bytesConsumed: originalBufferLength - buffer.Length); 1211ReadOnlySpan<byte> headerValue = buffer.Slice(valueStartIdx, buffer.Length - valueIterator.Length + crOrLfIdx - valueStartIdx); 1215buffer = buffer.Slice(buffer.Length - valueIterator.Length + spIdx); 1774int toCopy = Math.Min(available.Length, buffer.Length); 1835if (destination.Length == 0)
System\Net\Http\SocketsHttpHandler\RawConnectionStream.cs (1)
34if (bytesRead == 0 && buffer.Length != 0)
System.Net.Http.WinHttpHandler (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
47int length = FormatMessage(flags, moduleHandle, unchecked((uint)errorCode), 0, bufferPtr, stackBuffer.Length, IntPtr.Zero);
System.Net.HttpListener (7)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
System\Net\HttpListener.cs (1)
206toLowerLength = destination.Length;
System.Net.Mail (31)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Net\Base64Stream.cs (1)
85while (source < buffer.Length)
System\Net\BufferedReadStream.cs (2)
36int read = Math.Min(buffer.Length, _storedLength - _storedOffset); 39if (read == buffer.Length || !_readMore)
System\Net\Mail\SmtpNegotiateAuthenticationModule.cs (1)
150if (unwrappedChallenge.Length != 4 || (unwrappedChallenge[0] & 1) != 1)
System\Net\Mail\SmtpReplyReaderFactory.cs (1)
240if (buffer.Length == 0 || _currentReader != caller || _readState == ReadState.Done)
System\Net\Mime\QEncodedStream.cs (3)
85if (buffer.Length == 1) 129while (source < buffer.Length) 153switch (buffer.Length - source)
System\Net\Mime\QuotedPrintableStream.cs (3)
114if (buffer.Length == 1) 158while (source < buffer.Length) 174switch (buffer.Length - source)
System.Net.NameResolution (21)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (7)
81err = Interop.Sys.SetAddressFamily(rawAddress, buffer.Length, (int)family); 106err = Interop.Sys.SetPort(rawAddress, buffer.Length, port); 132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope); 144err = Interop.Sys.SetIPv4Address(rawAddress, buffer.Length, address); 161SetIPv6Address(buffer, rawInput, address.Length, scope); 170err = Interop.Sys.SetIPv6Address(rawAddress, buffer.Length, address, addressLength, scope); 181buffer[0] = (byte)Math.Min(buffer.Length, 255);
System\Net\DnsEncodedName.cs (10)
92if (destination.Length < 1) 131if (wireLen > destination.Length) 147int labelLen = dotIdx >= 0 ? dotIdx : body.Length - labelStart; 266if (asciiWritten <= destination.Length) 328if (encoded.Length > destination.Length) 342if (bytesWritten + 1 + label.Length > destination.Length) 352if (bytesWritten >= destination.Length) 383if (charsWritten >= destination.Length) 392if (charsWritten + label.Length > destination.Length) 411if (destination.Length < 1)
System\Net\DnsMessageHeader.cs (1)
25if (destination.Length < Size)
System\Net\DnsMessageWriter.cs (1)
44if (destination.Length < 4 ||
System\Net\DnsResolver.cs (1)
540for (int i = bytes.Length - 1; i >= 0; i--)
System\Net\DnsResolverPal.Managed.cs (1)
783while (totalReceived < buffer.Length)
System.Net.NetworkInformation (7)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
System\Net\NetworkInformation\UnicastIPAddressInformation.cs (1)
80Debug.Assert(prefixLength <= (addressBytes.Length * 8));
System.Net.Ping (10)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (7)
81err = Interop.Sys.SetAddressFamily(rawAddress, buffer.Length, (int)family); 106err = Interop.Sys.SetPort(rawAddress, buffer.Length, port); 132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope); 144err = Interop.Sys.SetIPv4Address(rawAddress, buffer.Length, address); 161SetIPv6Address(buffer, rawInput, address.Length, scope); 170err = Interop.Sys.SetIPv6Address(rawAddress, buffer.Length, address, addressLength, scope); 181buffer[0] = (byte)Math.Min(buffer.Length, 255);
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (2)
41if ((long)MaxUtf8BytesPerChar * managed.Length >= buffer.Length) 45if (exactByteCount > buffer.Length)
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
308header.SocketAddressLen = socketAddress.Length;
System.Net.Primitives (20)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (1)
41for (int i = 0; i < numbers.Length; ++i)
src\runtime\src\libraries\Common\src\System\Net\NetworkInformation\InterfaceInfoPal.Unix.cs (1)
62buffer[buffer.Length - 1] = 0;
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (7)
81err = Interop.Sys.SetAddressFamily(rawAddress, buffer.Length, (int)family); 106err = Interop.Sys.SetPort(rawAddress, buffer.Length, port); 132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope); 144err = Interop.Sys.SetIPv4Address(rawAddress, buffer.Length, address); 161SetIPv6Address(buffer, rawInput, address.Length, scope); 170err = Interop.Sys.SetIPv6Address(rawAddress, buffer.Length, address, addressLength, scope); 181buffer[0] = (byte)Math.Min(buffer.Length, 255);
System\Net\IPAddress.cs (5)
326if (destination.Length < IPAddressParserStatics.IPv6AddressBytes) 337if (destination.Length < IPAddressParserStatics.IPv4AddressBytes) 504if (destination.Length >= IPAddressParser.MaxIPv4StringLength) 512if (destination.Length >= IPAddressParser.MaxIPv6StringLength) 520Debug.Assert(tmpDestination.Length >= IPAddressParser.MaxIPv4StringLength);
System.Net.Quic (25)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs (2)
29return BioGets(b, pBuf, buf.Length); 35internal static int BioRead(SafeBioHandle b, Span<byte> data) => BioRead(b, data, data.Length);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (1)
41for (int i = 0; i < numbers.Length; ++i)
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
387if (destination.Length < _length)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (7)
81err = Interop.Sys.SetAddressFamily(rawAddress, buffer.Length, (int)family); 106err = Interop.Sys.SetPort(rawAddress, buffer.Length, port); 132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope); 144err = Interop.Sys.SetIPv4Address(rawAddress, buffer.Length, address); 161SetIPv6Address(buffer, rawInput, address.Length, scope); 170err = Interop.Sys.SetIPv6Address(rawAddress, buffer.Length, address, addressLength, scope); 181buffer[0] = (byte)Math.Min(buffer.Length, 255);
src\runtime\src\libraries\Common\src\System\Net\StreamBuffer.cs (1)
205int bytesRead = Math.Min(buffer.Length, _buffer.ActiveMemory.Length);
System\Net\Quic\Internal\ReceiveBuffers.cs (4)
56if (totalLength < quicBuffer.Length) 61_buffer.Commit(quicBuffer.Length); 62totalCopied += quicBuffer.Length; 63totalLength -= quicBuffer.Length;
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (1)
206if (chainData.Length > 0)
System\Net\Quic\QuicStream.Stream.cs (2)
118byte[] rentedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 126int readLength = ReadAsync(new Memory<byte>(rentedBuffer, 0, buffer.Length), cts?.Token ?? default).AsTask().GetAwaiter().GetResult();
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 (47)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs (2)
29return BioGets(b, pBuf, buf.Length); 35internal static int BioRead(SafeBioHandle b, Span<byte> data) => BioRead(b, data, data.Length);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (11)
275Ssl.SslCtxSetCaching(sslCtx, 1, cacheSize, contextId.Length, contextId, null, null); 744outputSpan.Length, 792int drained = Ssl.BioDrainSpill(context.OutputBio!, spillPtr, spillDst.Length); 856windowSpan.Length, 888int drained = Ssl.BioDrainSpill(context.OutputBio!, spillPtr, spillDst.Length); 930int drained = Ssl.BioDrainSpill(context.OutputBio!, dstPtr, dst.Length); 951input.Length, 954output.Length, 966Debug.Assert(consumed == input.Length, "Expected all input to be consumed."); 1232while (clientList.Length > 0) 1348Debug.Assert(buffer.Length >= count);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (5)
91int algorithmCount = algorithms.Length; 94if (res != 0 || algorithmCount > algorithms.Length) 348Debug.Assert(GetAlpnProtocolListSerializedLength(applicationProtocols) == buffer.Length, 372return SslSetAlpnProtos(ssl, pBuffer, serializedProtocols.Length); 388return SslAddClientCAs(ssl, pHandles, x509handles.Length);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (1)
41for (int i = 0; i < numbers.Length; ++i)
src\runtime\src\libraries\Common\src\System\Net\Security\MD4.cs (3)
65Debug.Assert(destination.Length == 128 >> 3); 175for (int i = 0, j = 0; j < output.Length; i++, j += 4) 183for (int i = 0, j = 0; i < output.Length; i++, j += 4)
src\runtime\src\libraries\Common\src\System\Net\Security\RC4.cs (1)
78Debug.Assert(input.Length == output.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (2)
57Return(_skipClear ? 0 : Span.Length); 114if (currentBuffer.Length >= length)
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (6)
365Debug.Assert(asBytes.Length == sizeof(NegotiateMessage)); 455Debug.Assert(clientChallenge.Length == ChallengeLength); 478SetField(ref field, blob.Length, payloadOffset); 480payloadOffset += blob.Length; 887unwrappedLength = input.Length - SignatureLength; 894if (input.Length < SignatureLength)
System\Net\Security\SslStream.cs (1)
791PoolingPointerMemoryManager memoryManager = RentPointerMemoryManager(ref _readPointerMemoryManager, ptr, buffer.Length);
System\Net\Security\SslStream.Protocol.cs (2)
186Debug.Assert(ret && written == certHash.Length); 1088if (_buffer.DecryptedSpan.Length > 0)
System\Net\Security\TlsSession.cs (6)
589if (destination.Length < source.Length) 1286if (needed > plaintext.Length) 1289SR.Format(SR.net_tlssession_plaintext_buffer_too_small, needed, plaintext.Length)); 1368if (produced > plaintext.Length) 1371SR.Format(SR.net_tlssession_plaintext_buffer_too_small, produced, plaintext.Length)); 1560int n = Math.Min(output.Length, _pendingBuffer.ActiveLength);
System\Net\Security\TlsSession.OpenSsl.cs (1)
249int ret = Interop.Ssl.SslRead(ssl, ref MemoryMarshal.GetReference(buffer), buffer.Length, out Interop.Ssl.SslErrorCode err);
System.Net.ServerSentEvents (3)
System\Net\ServerSentEvents\Helpers.cs (3)
18Debug.Assert(MaxDecimalDigits <= buffer.Length); 36Debug.Assert(value.Length <= buffer.Length); 50Debug.Assert(buffer.Length >= maxByteCount);
System.Net.Sockets (38)
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (7)
81err = Interop.Sys.SetAddressFamily(rawAddress, buffer.Length, (int)family); 106err = Interop.Sys.SetPort(rawAddress, buffer.Length, port); 132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope); 144err = Interop.Sys.SetIPv4Address(rawAddress, buffer.Length, address); 161SetIPv6Address(buffer, rawInput, address.Length, scope); 170err = Interop.Sys.SetIPv6Address(rawAddress, buffer.Length, address, addressLength, scope); 181buffer[0] = (byte)Math.Min(buffer.Length, 255);
System\Net\Sockets\SafeSocketHandle.Unix.OptionTracking.cs (2)
34Debug.Assert(values.Length == TrackableOptionCount); 64for (int i = 0; i < values.Length; i++)
System\Net\Sockets\Socket.cs (6)
143int bufferLength = buffer.Length; 152Debug.Assert(bufferLength <= buffer.Length); 186bufferLength = buffer.Length; 312int size = buffer.Length; 360int size = buffer.Length; 2300int realOptionLength = optionValue.Length;
System\Net\Sockets\SocketAsyncContext.Unix.cs (2)
1689Length = buffer.Length, 1909Length = buffer.Length,
System\Net\Sockets\SocketPal.Unix.cs (21)
113received = Interop.Sys.Read(handle, b, buffer.Length); 131buffer.Length, 155Count = (UIntPtr)buffer.Length 158Debug.Assert(socketAddress.Length != 0 || sockAddr == null); 162SocketAddressLen = socketAddress.Length, 414int sockAddrLen = socketAddress.Length; 498Count = (UIntPtr)buffer.Length 501Debug.Assert(socketAddress.Length != 0 || rawSocketAddress == null); 505SocketAddressLen = socketAddress.Length, 531socketAddressLen = socketAddress.Length; 580SocketAddressLen = socketAddress.Length, 603socketAddressLen = socketAddress.Length; 685if (data.Length > 0) 688err = Interop.Sys.Connectx(socket, rawSocketAddress, socketAddress.Length, data, data.Length, tfo ? 1 : 0, &sentBytes); 785else if (buffer.Length == 0) 853else if (buffer.Length == 0) 1686Debug.Assert((uint)optionLength <= optionValue.Length); 1851Interop.Error err = Interop.Sys.Select(readFDs, readFDs.Length, writeFDs, writeFDs.Length, errorFDs, errorFDs.Length, microseconds, maxFd, out triggered); 1894Debug.Assert(buffer.Length == socketList.Count);
System.Net.WebClient (6)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
System.Net.WebSockets (16)
System\Net\WebSockets\Compression\WebSocketDeflater.cs (7)
95Debug.Assert(written == output.Length); 133_stream.AvailOut = (uint)output.Length; 141written = output.Length - (int)_stream.AvailOut; 149|| written == output.Length; 157Debug.Assert(output.Length > 0); 165_stream.AvailOut = (uint)output.Length; 188return output.Length - (int)_stream.AvailOut;
System\Net\WebSockets\Compression\WebSocketInflater.cs (7)
132if (_available > 0 && output.Length > 0) 183if (output.Length == written) 193if (output.Length > written) 200if (written < output.Length || IsFinished(_stream, out _remainingByte)) 242Debug.Assert(destination.Length > 0); 248stream.AvailOut = (uint)destination.Length; 255return destination.Length - (int)stream.AvailOut;
System\Net\WebSockets\ManagedWebSocket.cs (2)
920int limit = (int)Math.Min(header.Compressed ? _inflater!.Span.Length : payloadBuffer.Length, header.PayloadLength); 1688byte* toMaskEnd = toMaskBeg + toMask.Length;
System.Numerics.Tensors (81)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBinaryOperator.cs (2)
66if (x.Length > destination.Length) 1400if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBooleanUnaryOperator.cs (1)
187if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IStatefulUnaryOperator.cs (1)
34if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.ITernaryOperator.cs (3)
51if (x.Length > destination.Length) 1528if (x.Length > destination.Length) 3016if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryInputBinaryOutput.cs (6)
51if (x.Length > destination1.Length) 56if (x.Length > destination2.Length) 183if (x.Length > destination1.Length) 188if (x.Length > destination2.Length) 367if (x.Length > destination1.Length) 372if (x.Length > destination2.Length)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToFourOperator.cs (1)
35if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToTwoOperator.cs (1)
35if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOperator.cs (1)
70if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryTwoToOneOperator.cs (1)
35if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (1)
461if (_shape.FlattenedLength <= destination.Length)
System\Numerics\Tensors\netcore\Tensor.cs (7)
381for (int i = 0; i < span.Length; i++) 418for (int i = 0; i < span.Length; i++) 1618span.Slice(0, ospan.Length).CopyTo(ospan); 1672if (ospan.Length >= span.Length) 1678span.Slice(0, ospan.Length).CopyTo(ospan); 1757for (int i = 0; i < srcIndexes.Length; i++) 1879for (int i = 0; i < sliceDims.Length; i++)
System\Numerics\Tensors\netcore\TensorOperation.cs (34)
133for (int i = 0; i < destinationIndexes.Length - 1; i++) 162for (nint i = 0; i < destination.Length; i++) 443for (int i = 0; i < destination.Length; i++) 451for (int i = 0; i < destination.Length; i++) 480Debug.Assert(destination.Length == 1); 483for (int i = 0; i < destination.Length; i++) 498Debug.Assert(destination.Length == 1); 501for (int i = 0; i < destination.Length; i++) 674for (int i = 0; i < destination.Length; i++) 703for (int i = 0; i < destination.Length; i++) 2337for (int i = 0; i < destination.Length; i++) 2345for (int i = 0; i < destination.Length; i++) 2374Debug.Assert(destination.Length == 1); 2377for (int i = 0; i < destination.Length; i++) 2392Debug.Assert(destination.Length == 1); 2395for (int i = 0; i < destination.Length; i++) 2426for (int i = 0; i < destination.Length; i++) 2434for (int i = 0; i < destination.Length; i++) 2463Debug.Assert(destination.Length == 1); 2466for (int i = 0; i < destination.Length; i++) 2481Debug.Assert(destination.Length == 1); 2484for (int i = 0; i < destination.Length; i++) 2515for (int i = 0; i < destination.Length; i++) 2523for (int i = 0; i < destination.Length; i++) 2552Debug.Assert(destination.Length == 1); 2555for (int i = 0; i < destination.Length; i++) 2570Debug.Assert(destination.Length == 1); 2573for (int i = 0; i < destination.Length; i++) 2604for (int i = 0; i < destination.Length; i++) 2612for (int i = 0; i < destination.Length; i++) 2641Debug.Assert(destination.Length == 1); 2644for (int i = 0; i < destination.Length; i++) 2659Debug.Assert(destination.Length == 1); 2662for (int i = 0; i < destination.Length; i++)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertHelpers.cs (1)
19if (source.Length > destination.Length)
System\Numerics\Tensors\netcore\TensorPrimitives.IsCanonical.cs (1)
23if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\TensorPrimitives.IsComplexNumber.cs (1)
23if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\TensorPrimitives.IsFinite.cs (1)
23if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\TensorPrimitives.IsImaginaryNumber.cs (1)
23if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\TensorPrimitives.IsInteger.cs (1)
23if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNaN.cs (1)
23if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNegative.cs (1)
23if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\TensorPrimitives.IsRealNumber.cs (1)
23if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\TensorPrimitives.SoftMax.cs (1)
32if (x.Length > destination.Length)
System\Numerics\Tensors\netcore\TensorShape.cs (7)
409Debug.Assert(indexes.Length >= Rank); 410Debug.Assert(indexes.Length == destinationShape.Rank); 446if (indexes.Length != Rank) 474Debug.Assert(indexes.Length >= Rank); 475Debug.Assert(indexes.Length == destinationShape.Rank); 511if (indexes.Length != Rank) 811if (intermediateLengths.Length != 0)
System\Numerics\Tensors\netcore\TensorSpan_1.cs (2)
77_shape = TensorShape.Create(ref reference, span.Length, pinned: false); 89_shape = TensorShape.Create(ref reference, span.Length, lengths, strides, pinned: false);
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (2)
30Debug.Assert(destination1.Length >= inputLength); 31Debug.Assert(destination1.Length >= inputLength);
System\Numerics\Tensors\TensorPrimitives.Single.cs (1)
852if (x.Length > destination.Length)
System.Private.CoreLib (621)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.IsMemberOfGroup.cs (2)
30rv = Interop.Sys.GetGroups(groups.Length, pGroups); 41groups = new uint[groups.Length * 2];
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (3)
43int resultLength = ReadLink(path, ref MemoryMarshal.GetReference(spanBuffer), spanBuffer.Length); 51else if (resultLength < spanBuffer.Length) 71arrayBuffer = ArrayPool<byte>.Shared.Rent(spanBuffer.Length * 2);
src\runtime\src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (1)
30if (bitArrayIndex < (uint)span.Length)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (12)
32Debug.Assert(value <= _span.Length); 53if ((uint)pos < (uint)span.Length) 69if (source.Length == 1 && (uint)pos < (uint)span.Length) 83if ((uint)(_pos + source.Length) > (uint)_span.Length) 96if ((uint)(_pos + source.Length) > (uint)_span.Length) 113if ((uint)(pos + length) <= (uint)span.Length) 137Debug.Assert(_pos == _span.Length); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 215int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _pos + additionalCapacityBeyondPos); 225nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (7)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 307Debug.Assert(source.Length <= (destination.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (4)
236Debug.Assert(destination.Length >= 2); 680if (thousandsSepCtr >= thousandsSepPos.Length) 682var newThousandsSepPos = new int[thousandsSepPos.Length * 2]; 1022for (int j = 0; j < groupBuffer.Length; j++)
src\runtime\src\libraries\Common\src\System\Number.NumberBuffer.cs (3)
63for (numDigits = 0; numDigits < Digits.Length; numDigits++) 76Debug.Assert(numDigits < Digits.Length, "Null terminator not found in Number"); 91for (int i = 0; i < Digits.Length; i++)
src\runtime\src\libraries\Common\src\System\Number.Parsing.Common.cs (1)
104int maxDigCount = number.Digits.Length - 1;
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (2)
256if (parts.Length is < 2 or > 4) 262for (int i = 0; i < parts.Length; i++)
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (2)
41if ((long)MaxUtf8BytesPerChar * managed.Length >= buffer.Length) 45if (exactByteCount > buffer.Length)
src\runtime\src\libraries\Common\src\System\Sha1ForNonSecretPurposes.cs (4)
29Debug.Assert(destination.Length == 20); 58while (tail.Length > 0) 68for (int i = 80; i < w.Length; i++) 139Debug.Assert(output.Length == 20);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.cs (2)
1565if (foundCount >= span.Length) 1567values = new T[Math.Min((uint)span.Length * 2, (uint)array.Length)];
src\runtime\src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (14)
44if (destination.Length < sizeof(byte)) 72if (destination.Length < sizeof(char)) 100if (destination.Length < sizeof(short)) 128if (destination.Length < sizeof(int)) 156if (destination.Length < sizeof(long)) 184if (destination.Length < Int128.Size) 214if (destination.Length < sizeof(ushort)) 244if (destination.Length < sizeof(uint)) 274if (destination.Length < sizeof(ulong)) 304if (destination.Length < UInt128.Size) 332if (destination.Length < sizeof(BFloat16)) 360if (destination.Length < sizeof(Half)) 388if (destination.Length < sizeof(float)) 416if (destination.Length < sizeof(double))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (2)
289if (destination.Length < source.Length) 381if (destination.Length < source.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\MemoryManager.cs (1)
16public virtual Memory<T> Memory => new Memory<T>(this, GetSpan().Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (2)
160Debug.Assert(destination.Length == FormatStringLength); 164if (symbol != default && destination.Length == FormatStringLength)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Encoder.cs (1)
207Debug.Assert(buffer.Length == charsWritten, $"The source length: {source.Length}, chars written: {charsWritten}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (9)
39int destLength = bytes.Length; 348uint bufferLength = (uint)buffer.Length; 352if (decoder.IsInvalidLength(buffer.Length)) 531for (; encodedIdx < source.Length && (uint)bufferIdx < (uint)buffer.Length; ++encodedIdx) 636for (; encodedIdx < source.Length && (uint)bufferIdx < (uint)buffer.Length; ++encodedIdx) 760int BlockSize = Math.Min(source.Length - (int)sourceIndex, 4); 768while (sourceIndex < (uint)source.Length) 772while (bufferIdx < BlockSize && sourceIndex < (uint)source.Length) 800Debug.Assert(source.Length == sourceIndex);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64EncoderHelper.cs (2)
36int destLength = destination.Length; 604if (buffer.Length < encodedLength)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlEncoder.cs (1)
162Debug.Assert(buffer.Length == charsWritten, $"The source length: {source.Length}, bytes written: {charsWritten}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Number.cs (1)
61int maxDigitCount = digits.Length - 1;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (2)
368if (destination.Length >= sizeof(byte)) 385if (destination.Length >= sizeof(byte))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (1)
537for (i = 0; i < thisRemaining.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (66)
125if (keys.Length > 1) 127IntroSort(keys, 2 * (BitOperations.Log2((uint)keys.Length) + 1), comparer); 140int partitionSize = keys.Length; 181Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 184int hi = keys.Length - 1; 222int n = keys.Length; 260for (int i = 0; i < keys.Length - 1; i++) 289if (keys.Length > 1) 299if (nanLeft == keys.Length) 306IntroSort(keys, 2 * (BitOperations.Log2((uint)keys.Length) + 1)); 416int partitionSize = keys.Length; 460Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 464ref T lastRef = ref Unsafe.Add(ref zeroRef, keys.Length - 1); 465ref T middleRef = ref Unsafe.Add(ref zeroRef, (keys.Length - 1) >> 1); 471ref T nextToLastRef = ref Unsafe.Add(ref zeroRef, keys.Length - 2); 511int n = keys.Length; 547for (int i = 0; i < keys.Length - 1; i++) 636Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 637Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 669Debug.Assert(keys.Length == values.Length); 671if (keys.Length > 1) 673IntroSort(keys, values, 2 * (BitOperations.Log2((uint)keys.Length) + 1), comparer); 680Debug.Assert(values.Length == keys.Length); 684int partitionSize = keys.Length; 725Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 728int hi = keys.Length - 1; 766int n = keys.Length; 810for (int i = 0; i < keys.Length - 1; i++) 840if (keys.Length > 1) 850if (nanLeft == keys.Length) 858IntroSort(keys, values, 2 * (BitOperations.Log2((uint)keys.Length) + 1)); 910Debug.Assert(values.Length == keys.Length); 913int partitionSize = keys.Length; 954Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 956int hi = keys.Length - 1; 1001int n = keys.Length; 1041for (int i = 0; i < keys.Length - 1; i++) 1117for (int i = 0; i < keys.Length; i++) 1127if ((uint)i < (uint)values.Length) // check to see if we have values 1194if (keys.Length > 1) 1196IntroSort(keys, 2 * (BitOperations.Log2((uint)keys.Length) + 1), comparer); 1209int partitionSize = keys.Length; 1249Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 1252int hi = keys.Length - 1; 1290int n = keys.Length; 1328for (int i = 0; i < keys.Length - 1; i++) 1388Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 1389Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 1407Debug.Assert(keys.Length == values.Length); 1409if (keys.Length > 1) 1411IntroSort(keys, values, 2 * (BitOperations.Log2((uint)keys.Length) + 1), comparer); 1418Debug.Assert(values.Length == keys.Length); 1422int partitionSize = keys.Length; 1462Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 1465int hi = keys.Length - 1; 1502int n = keys.Length; 1546for (int i = 0; i < keys.Length - 1; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Convert.cs (15)
2301int i = chars.Length; 2366Debug.Assert(buffer.Length == charsWritten, $"Expected {buffer.Length} == {charsWritten}"); 2432if (charLengthRequired > chars.Length) 2455Debug.Assert(destination.Length >= ToBase64_CalculateAndValidateOutputLength(source.Length, insertLineBreaks: true)); 2671if (destination.Length < quotient) 2673source = source.Slice(0, destination.Length * 2); 2674quotient = destination.Length; 2727if (destination.Length < quotient) 2729utf8Source = utf8Source.Slice(0, destination.Length * 2); 2730quotient = destination.Length; 2820else if ((source.Length > (int.MaxValue / 2)) || (destination.Length < (source.Length * 2))) 2843else if ((source.Length > (int.MaxValue / 2)) || (utf8Destination.Length < (source.Length * 2))) 2915else if ((source.Length > (int.MaxValue / 2)) || (destination.Length < (source.Length * 2))) 2938else if ((source.Length > (int.MaxValue / 2)) || (utf8Destination.Length < (source.Length * 2)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (2)
817Debug.Assert(charsWritten == destination.Length); 823Debug.Assert(charsWritten == destination.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (6)
587if (destination.Length <= 3) 608if (destination.Length <= 3) 1142if (destination.Length >= sizeof(sbyte)) 1156if (destination.Length >= sizeof(sbyte)) 1170if (destination.Length >= (sizeof(uint) + sizeof(ulong))) 1187if (destination.Length >= (sizeof(ulong) + sizeof(uint)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (2)
1078for (int cur = 0; cur < num.Length; cur++) 2302Debug.Assert(buf.Length == BufLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.cs (1)
134return Enable(outputFilePath, format, circularBufferSizeInMB, providersNativePointer, (uint)providersNative.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (3)
506if (refObjIndex >= dataRefObj.Length) 508Span<object?> newDataRefObj = new object?[dataRefObj.Length * 2]; 512Span<int> newRefObjPosition = new int[refObjPosition.Length * 2];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (2)
1556if (sizeof(TStorage) * 2 <= destination.Length) 1993if (length <= destination.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Exception.cs (1)
175Debug.Assert(resultSpan.Length == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (2)
132return Interop.Globalization.GetCalendarInfo(locale, id, type, bufferPtr, buffer.Length); 223Debug.Assert(index + 3 < modifiedPattern.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (7)
787actualSortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pDest, destination.Length, options); 793if ((uint)actualSortKeyLength > (uint)destination.Length) 795if (actualSortKeyLength > destination.Length) 900sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKey.Length, options); 904if (sortKeyLength > sortKey.Length) // slow path for big strings 923sortKeyLength = Interop.Globalization.GetSortKey(_sortHandle, pSource, source.Length, pSortKey, sortKey.Length, options); 929if (sortKeyLength == 0 || sortKeyLength > sortKey.Length) // internal error (0) or a bug (2nd call failed) in ucol_getSortKey
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Invariant.cs (3)
46Debug.Assert(sortKey.Length >= source.Length * sizeof(char)); 58Debug.Assert(sortKey.Length >= source.Length * sizeof(char)); 93if ((uint)destination.Length < (uint)source.Length * sizeof(char))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (2)
448pSortKey, destination.Length, 470Debug.Assert(actualSortKeyLength <= destination.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (1)
88if (buffer.Length - bufferIndex >= length + 1)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (9)
1329if (destination.Length < 16) 1354if (destination.Length < 8) 1378if (destination.Length < 10) 1402if (destination.Length < 16) 1464if (destination.Length < charsRequired) 1525if (destination.Length < FormatSLength) 1557if (destination.Length < FormatuLength) 1595if (destination.Length < FormatRLength) 1663if (destination.Length < bytesRequired)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (3)
283if (unicode.Length <= destination.Length) 310if (result.Length <= destination.Length) 692if (strUnicode.Length <= destination.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (6)
60int actualLength = Interop.Globalization.ToAscii(flags, unicode, unicode.Length, destination, destination.Length); 62if (actualLength <= destination.Length) 104int realLen = Interop.Globalization.ToUnicode(flags, ascii, ascii.Length, output, output.Length); 110else if (realLen <= output.Length) 131int actualLength = Interop.Globalization.ToUnicode(flags, ascii, ascii.Length, destination, destination.Length); 133if (actualLength <= destination.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (8)
46int length = Interop.Normaliz.IdnToAscii(flags, unicode, unicode.Length, output, output.Length); 51Debug.Assert(length == output.Length); 69if (length > destination.Length) 76int actualLength = Interop.Normaliz.IdnToAscii(flags, unicode, unicode.Length, destination, destination.Length); 120int length = Interop.Normaliz.IdnToUnicode(flags, ascii, ascii.Length, output, output.Length); 125Debug.Assert(length == output.Length); 143if (length > destination.Length) 150int actualLength = Interop.Normaliz.IdnToUnicode(flags, ascii, ascii.Length, destination, destination.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (2)
114Debug.Assert(source.Length <= destination.Length); 140Debug.Assert(source.Length <= destination.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (4)
78realLen = Interop.Globalization.NormalizeString(normalizationForm, pInput, strInput.Length, pDest, buffer.Length); 87if (realLen <= buffer.Length) 149realLen = Interop.Globalization.NormalizeString(normalizationForm, pInput, source.Length, pDest, destination.Length); 158if (realLen <= destination.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (3)
65realLength = Interop.Normaliz.NormalizeString(normalizationForm, pInput, strInput.Length, pDest, buffer.Length); 80Debug.Assert(realLength > buffer.Length, "Buffer overflow should have iLength > cBuffer.Length"); 136realLength = Interop.Normaliz.NormalizeString(normalizationForm, pInput, source.Length, pDest, destination.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (2)
693if (destination.Length < source.Length) 718if (destination.Length < source.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (3)
237Debug.Assert(destination.Length >= source.Length); 244Debug.Assert(destination.Length >= source.Length); 295pDestination + charsConsumed, destination.Length - charsConsumed, toUpper);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (1)
226if (destination.Length < requiredOutputLength)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (4)
1036if (destination.Length < 16) 1055if (destination.Length < 16) 1329if ((byte)flags > destination.Length) 1453if (dest.Length < 68)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (2)
1404if (destination.Length >= sizeof(sbyte)) 1418if (destination.Length >= sizeof(sbyte))
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (3)
326int numBytes = buffer.Length; 474Debug.Assert(buffer.Length != 1, "length of 1 should use ReadByte."); 480return Unsafe.As<MemoryStream>(_stream).InternalReadSpan(buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (1)
196if (maxByteCount > buffer.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (3)
448int readbytes = Math.Min(_readLen - _readPos, destination.Length); 536if (bytesFromBuffer == destination.Length) 558if (destination.Length >= _bufferSize)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (1)
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 (2)
86Debug.Assert(Directory.Length + FileName.Length < _pathBuffer.Length, 87$"directory ({Directory.Length} chars) & name ({Directory.Length} chars) too long for buffer ({_pathBuffer.Length} chars)");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemName.cs (3)
253if (currentMatch >= currentMatches.Length - 2) 255int newSize = currentMatches.Length * 2; 383int previousLength = priorMatches.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (5)
1521if (bytesRead == buffer.Length) 1523uint newLength = (uint)buffer.Length * 2; 1526newLength = (uint)Math.Max(Array.MaxLength, buffer.Length + 1); 1539Debug.Assert(bytesRead < buffer.Length); 1600fileOffset += toStore.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (1)
355int n = Math.Min(_length - _position, buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (5)
592if (destination.Length < pathToUse.Length) 604if (destination.Length < charsNeeded) 636if (destination.Length < charsNeeded) 781Debug.Assert(fourth.Length == destination.Length); 799Debug.Assert(chars.Length == 12, $"Unexpected {nameof(chars)}.Length");
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 (5)
35result = Interop.Sys.ReadFromNonblocking(handle, bufPtr, buffer.Length); 40result = Interop.Sys.PRead(handle, bufPtr, buffer.Length, fileOffset); 50result = Interop.Sys.Read(handle, bufPtr, buffer.Length); 210bytesWritten = Interop.Sys.PWriteV(handle, pinnedVectors, left.Length, fileOffset); 220bytesWritten = Interop.Sys.WriteV(handle, pinnedVectors, left.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\ReadOnlyMemoryStream.cs (2)
114if (remaining <= 0 || buffer.Length == 0) 119int bytesToRead = Math.Min(remaining, buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (4)
178if (!_strategy.CanSeek || (destination.Length >= _bufferSize)) 207if (n > destination.Length) 209n = destination.Length; 231if (n < destination.Length && !isBlocked)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (6)
785byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 788int numRead = Read(sharedBuffer, 0, buffer.Length); 789if ((uint)numRead > (uint)buffer.Length) 821_ = ReadAtLeastCore(buffer, buffer.Length, throwOnEndOfStream: true); 883ValidateReadAtLeastArguments(buffer.Length, minimumBytes); 891Debug.Assert(minimumBytes <= buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (5)
403int count = buffer.Length; 484} while (i > 0 && n < buffer.Length); 722readToUserBuffer = userBuffer.Length >= _maxCharsPerBuffer; 775readToUserBuffer = userBuffer.Length >= _maxCharsPerBuffer; 811_isBlocked &= charsRead < userBuffer.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (2)
133if (n > buffer.Length) 135n = buffer.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StringStream.cs (7)
113if (buffer.Length == 0 || (_charPosition >= _text.Length && _pendingCount == 0 && _encoderFlushed)) 129buffer.Length >= _encoding.GetMaxByteCount(_text.Length)) 143int toCopy = Math.Min(_pendingCount, buffer.Length); 149if (totalBytesWritten == buffer.Length) 166if (buffer.Length < _maxBytesPerChar) 173int toCopy = Math.Min(bytesUsed, buffer.Length); 211int toCopy = Math.Min(flushBytes, flushTarget.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (6)
98char[] array = ArrayPool<char>.Shared.Rent(buffer.Length); 102int numRead = Read(array, 0, buffer.Length); 103if ((uint)numRead > (uint)buffer.Length) 148char[] array = ArrayPool<char>.Shared.Rent(buffer.Length); 152int numRead = ReadBlock(array, 0, buffer.Length); 153if ((uint)numRead > (uint)buffer.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (1)
372long n = Math.Min(len - pos, buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\WritableMemoryStream.cs (2)
116if (remaining <= 0 || buffer.Length == 0) 121int bytesToRead = Math.Min(remaining, buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Memory.cs (1)
318lengthOfUnderlyingSpan = memoryManagerSpan.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (37)
3717if (span.Length > 1) 3719SpanHelpers.Reverse(ref MemoryMarshal.GetReference(span), (nuint)span.Length); 4179/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 4201/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 4226/// no larger element, the bitwise complement of <see cref="Span{T}.Length"/>. 4346if (span.Length > 1) 4373if (span.Length > 1) 4419if (keys.Length != items.Length) 4422if (keys.Length > 1) 4454if (keys.Length != items.Length) 4457if (keys.Length > 1) 4473uint length = (uint)span.Length; 4551(uint)span.Length); 4563(uint)span.Length); 4574(uint)span.Length); 4585(uint)span.Length); 4593for (int i = 0; i < span.Length; i++) 4608for (int i = 0; i < span.Length; i++) 4638if (length > (uint)destination.Length) 4649(nuint)byteOffset > (nuint)(-((nint)destination.Length * sizeof(T))))) 4722if (length > (uint)destination.Length) 4733(nuint)byteOffset > (nuint)(-((nint)destination.Length * sizeof(T))))) 4828if (source.Length > destination.Length) 4878if (source.Length > destination.Length) 5201if (separators.IsEmpty && destination.Length > source.Length) 5242if (separators.IsEmpty && destination.Length > source.Length) 5289if (destination.Length == 1) 5333Span<Range> destinationMinusOne = destination.Slice(0, destination.Length - 1); 5334while (separatorIndex < separatorList.Length && (rangeCount < destinationMinusOne.Length || !keepEmptyEntries)) 5357if ((uint)rangeCount >= (uint)destinationMinusOne.Length) 5376if ((uint)rangeCount < (uint)destination.Length) 6091_success = shouldAppend = destination.Length >= literalLength; 6107_success = shouldAppend = destination.Length >= literalLength; 6326if (alignment <= _destination.Length - _pos) 6446if (paddingNeeded <= _destination.Length - _pos)
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (4)
247if (destination.Length < source.Length) 271if (destination.Length < source.Length) 299if (destination.Length < source.Length) 323if (destination.Length < source.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.cs (3)
790if (span.Length == 0 || 801for (; start < span.Length; start++) 809int end = span.Length - 1;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (1)
349Span<byte> utf8Bytes = MemoryMarshal.AsBytes(dest).Slice(dest.Length * 2 - state.byteCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.cs (2)
3662int index = scratch.Length; 3670int count = scratch.Length - index;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.DiyFp128DecimalReduce.cs (4)
230int columns = fractionWords.Length + Guard; 274int modLength = fractionWords.Length + ModGuard; 306int columns = fractionWords.Length + Guard; 354if (t < fractionWords.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (3)
67Debug.Assert(buffer.Length > 0); 250int cutoffExponent = digitExponent - buffer.Length; 562Debug.Assert(outputLen <= buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (37)
1780int leadingDigits = 2 - (buffer.Length & 1); 1783for (int i = pairs.Length - 1; (uint)i < (uint)pairs.Length; i--) 1829if (bufferLength > destination.Length) 1866if (bufferLength > destination.Length) 1880for (int i = buffer.Length - 1; (uint)i < (uint)buffer.Length; i--) 1914if (bufferLength > destination.Length) 1928for (int i = buffer.Length - 1; (uint)i < (uint)buffer.Length; i--) 1960Debug.Assert(destination.Length >= 4); 1970int cur = destination.Length - 1; 2028if (bufferLength <= destination.Length) 2046if (bufferLength <= destination.Length) 2119if (bufferLength > destination.Length) 2156if (bufferLength > destination.Length) 2185for (int i = buffer.Length - 1; (uint)i < (uint)buffer.Length; i--) 2220if (bufferLength > destination.Length) 2249for (int i = buffer.Length - 1; (uint)i < (uint)buffer.Length; i--) 2300int leadingDigits = 2 - (buffer.Length & 1); 2303for (int i = pairs.Length - 1; (uint)i < (uint)pairs.Length; i--) 2423if (bufferLength <= destination.Length) 2439if (bufferLength <= destination.Length) 2523if (bufferLength > destination.Length) 2564if (bufferLength > destination.Length) 2578if (buffer.Length > 16) 2580int upperLength = buffer.Length - 16; 2619if (bufferLength > destination.Length) 2633if (buffer.Length > 64) 2635int upperLength = buffer.Length - 64; 2686while (buffer.Length > 19) 2689Debug.Assert(buffer.Length > 19); 2690int index = buffer.Length - 19; 2754if (bufferLength <= destination.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (4)
1021if (destination.Length >= sizeof(sbyte)) 1035if (destination.Length >= sizeof(sbyte)) 1049if (destination.Length >= sizeof(byte)) 1063if (destination.Length >= sizeof(byte))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BigIntegerCalculator.Shared.cs (26)
197Debug.Assert(result.Length >= left.Length); 248Debug.Assert(result.Length >= left.Length); 303Debug.Assert(result.Length >= right.Length); 384Debug.Assert(bits.Length == left.Length + 1); 393Debug.Assert(bits.Length == left.Length + 1); 412Debug.Assert(left.Length >= right.Length); 427for (; carry != 0 && i < left.Length; i++) 441Debug.Assert(bits.Length == left.Length); 451Debug.Assert(bits.Length == left.Length); 468Debug.Assert(left.Length >= right.Length); 483for (; borrow != 0 && i < left.Length; i++) 595Debug.Assert(right.IsEmpty || bits.Length >= left.Length + right.Length); 613Debug.Assert(left.Length >= 1); 615Debug.Assert(left.Length >= right.Length); 617quotient.Length == 0 618|| quotient.Length == left.Length - right.Length + 1 619|| (CompareActual(left.Slice(left.Length - right.Length), right) < 0 && quotient.Length == left.Length - right.Length)); 644for (int i = left.Length; i >= right.Length; i--) 647nuint t = (uint)i < (uint)left.Length ? left[i] : 0; 690if ((uint)n < (uint)quotient.Length) 695if ((uint)i < (uint)left.Length) 704Debug.Assert(left.Length >= right.Length); 721Debug.Assert(left.Length >= right.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Colors\Argb.T.cs (1)
84if (destination.Length < 4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Colors\Rgba.T.cs (1)
84if (destination.Length < 4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\INumberBase.cs (1)
562int destinationMaxCharCount = Encoding.UTF8.GetMaxCharCount(utf8Destination.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector_1.cs (4)
660if (destination.Length < Vector<byte>.Count) 674if (destination.Length < Count) 781if (destination.Length < Vector<byte>.Count) 796if (destination.Length < Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (2)
1063if (destination.Length < ElementCount) 1076if (destination.Length < ElementCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (2)
1073if (destination.Length < ElementCount) 1086if (destination.Length < ElementCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (2)
1143if (destination.Length < ElementCount) 1156if (destination.Length < ElementCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.CompatImpl.cs (2)
244for (int i = 0; i < buffer.Length; i++) 332for (int i = 0; i < buffer.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (12)
514if (destination.Length < randomBytes.Length) 516randomBytes = randomBytes.Slice(0, destination.Length); 521for (int i = 0; i < randomBytes.Length; i++) 526destination = destination.Slice(randomBytes.Length); 542if (destination.Length * 2 < randomBytes.Length) 544randomBytes = randomBytes.Slice(0, destination.Length * 2); 552if ((uint)i >= (uint)destination.Length) 572for (int i = 0; i < destination.Length; i++) 654for (int i = 0; i < values.Length - 1; i++) 656int j = Next(i, values.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.Xoshiro256StarStarImpl.cs (3)
140while (buffer.Length >= sizeof(ulong)) 160Debug.Assert(buffer.Length < sizeof(ulong)); 161for (int i = 0; i < buffer.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (1)
240lengthOfUnderlyingSpan = memoryManagerSpan.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (2)
314if ((uint)_length <= (uint)destination.Length) 335if ((uint)_length <= (uint)destination.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyNameHelpers.StrongName.cs (1)
27publicKeyToken[i] = hash[hash.Length - 1 - i];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (1)
603for (int i = 0; i < bits.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (2)
440if (buffer.Length < MaxCompressedUInt32Size) 467if (buffer.Length < MaxCompressedUInt64Size)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (4)
595if (_chars.Length - _pos < additionalChars) 629Debug.Assert(additionalChars > _chars.Length - _pos); 640GrowCore((uint)_chars.Length + 1); 652uint newCapacity = Math.Max(requiredMinCapacity, Math.Min((uint)_chars.Length * 2, string.MaxLength));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (1)
56/// <see cref="BitArray.Length"/>. The returned span's <see cref="Span{Byte}.Length"/> will be the smallest number
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (3)
899for (int i = 0; i < dispatches.Length; i++) 903for (int j = 0; j < dispatchVtables.Length; j++) 905int index = i * dispatchVtables.Length + j;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\AnsiStringMarshaller.cs (2)
80if ((long)Marshal.SystemMaxDBCSCharSize * managed.Length >= buffer.Length) 84if (exactByteCount > buffer.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (1)
152if (array.Length <= buffer.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
81if (manualBstrNeeds > buffer.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (1)
153if (array.Length <= buffer.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (1)
120if (managed.Length <= buffer.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (6)
45numElements = managed.Length; 152if (managed.Length <= buffer.Length) 154_span = buffer[0..managed.Length]; 158int bufferSize = checked(managed.Length * sizeof(TUnmanagedElement)); 160_span = new Span<TUnmanagedElement>(_allocatedMemory, managed.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (2)
84if ((long)MaxUtf8BytesPerChar * managed.Length >= buffer.Length) 88if (exactByteCount > buffer.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (6)
40checked(span.Length * sizeof(T))); 133internal static unsafe ref T GetNonNullPinnableReference<T>(Span<T> span) => ref (span.Length != 0) ? ref Unsafe.AsRef(in span._reference) : ref Unsafe.AsRef<T>((void*)1); 168uint fromLength = (uint)span.Length; 555if (destination.Length < sizeof(T)) 574if (destination.Length < sizeof(T)) 598if (span.Length < sizeof(T))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (2)
239SpaceCheck(ptr, checked((nuint)(alignedSizeofT * buffer.Length))); 247for (int i = 0; i < buffer.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\ISimdVector_2.cs (2)
203if (destination.Length < TSelf.ElementCount) 787if (destination.Length < TSelf.ElementCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (2)
795if (destination.Length < Vector128<T>.Count) 3954if (destination.Length < Vector128<T>.Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (2)
801if (destination.Length < Vector256<T>.Count) 3905if (destination.Length < Vector256<T>.Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (2)
712if (destination.Length < Vector512<T>.Count) 3884if (destination.Length < Vector512<T>.Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (2)
752if (destination.Length < Vector64<T>.Count) 4069if (destination.Length < Vector64<T>.Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (1)
140for (int i = 1; i < components.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (2)
433if (destination.Length >= sizeof(sbyte)) 447if (destination.Length >= sizeof(sbyte))
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
175Debug.Assert(charsWritten == upperCase.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (1)
122for (int i = 0; i < bucketIndexes.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (2)
62Debug.Assert(i == normalizedValues.Length); 97Debug.Assert(newCount <= values.Length - unreachableValues.Count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (1)
362byteLength = (span.Length + 1) * sizeof(char);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (2)
715if (destination.Length >= sizeof(sbyte)) 734if (destination.Length >= sizeof(sbyte))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Span.cs (4)
249if (index < _span.Length) 332if ((uint)_length <= (uint)destination.Length) 353if ((uint)_length <= (uint)destination.Length) 444var destination = new T[Length];
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.cs (2)
442if ((uint)Length <= (uint)destination.Length) 459if ((uint)Length <= (uint)destination.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (1)
1463Debug.Assert(this.Length - thisIdx == dstSpan.Length - dstIdx);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (5)
171if (source.Length <= destination.Length) 178numElementsToConvert = (uint)destination.Length; 199nuint numElementsActuallyConverted = ChangeCase<T, T, TCasing>(pBuffer, pBuffer, (nuint)buffer.Length); 200Debug.Assert(numElementsActuallyConverted <= (nuint)buffer.Length); 203return elementsWritten == buffer.Length ? OperationStatus.Done : OperationStatus.InvalidData;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Transcoding.cs (4)
25if (source.Length <= destination.Length) 32numElementsToConvert = (uint)destination.Length; 60if (source.Length <= destination.Length) 67numElementsToConvert = (uint)destination.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (8)
322return GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length); 332int written = GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length, throwForDestinationOverflow: false); 394int numElementsToConvert = Math.Min(chars.Length, bytes.Length); 424return originalBytesLength - bytes.Length; // total number of bytes written 613return GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length); 623int written = GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length, throwForDestinationOverflow: false); 682int numElementsToConvert = Math.Min(bytes.Length, chars.Length); 712return originalCharsLength - chars.Length; // total number of chars written
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (2)
202return GetChars(bytesPtr, bytes.Length, charsPtr, chars.Length, flush); 308Convert(bytesPtr, bytes.Length, charsPtr, chars.Length, flush, out bytesUsed, out charsUsed, out completed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (2)
269int originalCharCount = chars.Length; 287charsWritten = originalCharCount - chars.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (3)
352Debug.Assert(combinedBufferBytesConsumed == combinedBuffer.Length, "We should be asked to persist the entire combined buffer."); 383if ((uint)total >= (uint)dest.Length) 395if ((uint)total >= (uint)dest.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (2)
199return GetBytes(charsPtr, chars.Length, bytesPtr, bytes.Length, flush); 307Convert(charsPtr, chars.Length, bytesPtr, bytes.Length, flush, out charsUsed, out bytesUsed, out completed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncoderFallback.cs (3)
195int originalBytesLength = bytes.Length; 218bytesWritten = originalBytesLength - bytes.Length; 239bytesWritten = originalBytesLength - bytes.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (4)
732return GetBytes(charsPtr, chars.Length, bytesPtr, bytes.Length); 744if (required <= bytes.Length) 881return GetChars(bytesPtr, bytes.Length, charsPtr, chars.Length); 893if (required <= chars.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (11)
542ThrowBytesOverflow(encoder, nothingEncoded: bytes.Length == originalByteCount); // might not throw if we wrote at least one byte 553bytesLength: bytes.Length, 573return originalByteCount - bytes.Length; // total number of bytes written up until now 656bytesLength: bytes.Length, 685ThrowBytesOverflow(encoder, nothingEncoded: bytes.Length == originalBytesLength); 704return originalBytesLength - bytes.Length; 1156charsLength: chars.Length, 1169return originalCharCount - chars.Length; // total number of chars written 1256charsLength: chars.Length, 1282ThrowCharsOverflow(decoder, nothingDecoded: chars.Length == originalCharsLength); 1299return originalCharsLength - chars.Length; // total number of chars written
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (5)
234return GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length); 244int written = GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length, throwForDestinationOverflow: false); 529return GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length); 536if (bytes.Length <= chars.Length) 541charsWritten = GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (5)
301Debug.Assert(buffer.Length >= MaxUtf16CharsPerRune); 1153else if (destination.Length > 1) 1200if (destination.Length > 1) 1211if (destination.Length > 2) 1223if (destination.Length > 3)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (3)
1773if ((uint)charsWritten > (uint)RemainingCurrentChunk.Length) 3038if ((uint)charsWritten > (uint)destination.Length) 3109if ((uint)charsWritten > (uint)destination.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (1)
353int bytesToReturn = Math.Min(_readBufferCount, buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (11)
66outputBytesRemaining: destination.Length, 95if (destination.Length <= 2) 157outputCharsRemaining: destination.Length, 252outputCharsRemaining: destination.Length, 289if (destination.Length < bytesConsumedJustNow) 374_success = shouldAppend = destination.Length >= literalLength; // UTF8 encoding never produces fewer bytes than input characters 390_success = shouldAppend = destination.Length >= literalLength; // UTF8 encoding never produces fewer bytes than input characters 408ref MemoryMarshal.GetReference(dest), dest.Length); 689GrowAndAppendFormatted(ref this, value, utf16.Length, out charsWritten, format); 736GrowAndAppendFormatted(ref this, value, utf16.Length, out charsWritten, format); 793if (paddingNeeded <= _destination.Length - _pos)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (5)
368return GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length); 378int written = GetBytesCommon(charsPtr, chars.Length, bytesPtr, bytes.Length, throwForDestinationOverflow: false); 563return GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length); 573int written = GetCharsCommon(bytesPtr, bytes.Length, charsPtr, chars.Length, throwForDestinationOverflow: false); 661return originalCharsLength - chars.Length; // total number of chars written
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (2)
3687for (int i = 0; i < continuations.Length; i++) 3747for (int i = 0; i < continuations.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (2)
988Debug.Assert(charsWritten == destination.Length); 994Debug.Assert(charsWritten == destination.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Cache.cs (2)
225if (encountered < offsets.Length) 234if (offsets.Length >= 2 && offsets[0] > offsets[1])
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.FullGlobalizationData.Unix.cs (2)
118return Interop.Globalization.GetTimeZoneDisplayName(locale, id, type, bufferPtr, buffer.Length); 138return Interop.Globalization.GetTimeZoneDisplayName(locale, id, type, bufferPtr, buffer.Length);
System\Reflection\DynamicInvokeInfo.cs (5)
257int argCount = parameters.Length; 320int argCount = parameters.Length; 690Debug.Assert(parameters.Length <= MaxStackAllocArgCount); 693Span<bool> shouldCopyBack = ((Span<bool>)copyBackStorage).Slice(0, parameters.Length); 705for (int i = 0; i < parameters.Length; i++)
System.Private.CoreLib.Generators (12)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (12)
32Debug.Assert(value <= _span.Length); 53if ((uint)pos < (uint)span.Length) 69if (source.Length == 1 && (uint)pos < (uint)span.Length) 83if ((uint)(_pos + source.Length) > (uint)_span.Length) 96if ((uint)(_pos + source.Length) > (uint)_span.Length) 113if ((uint)(pos + length) <= (uint)span.Length) 137Debug.Assert(_pos == _span.Length); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 215int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _pos + additionalCapacityBeyondPos); 225nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
System.Private.DataContractSerialization (15)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (1)
199int count = buffer.Length;
System\Runtime\Serialization\MemoryStreamAdapter.cs (1)
64if (slicedBuffer.Length < buffer.Length)
System\Xml\EncodingStreamWrapper.cs (1)
616int count = buffer.Length;
System\Xml\XmlBufferReader.cs (4)
493if (dst.Length > 0) 495GetBuffer(dst.Length, out _offset) 496.AsSpan(_offset, dst.Length) 499Advance(dst.Length);
System\Xml\XmlConverter.cs (2)
1099return chars.Length; 1140Debug.Assert(count == chars.Length);
System.Private.Uri (50)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (12)
32Debug.Assert(value <= _span.Length); 53if ((uint)pos < (uint)span.Length) 69if (source.Length == 1 && (uint)pos < (uint)span.Length) 83if ((uint)(_pos + source.Length) > (uint)_span.Length) 96if ((uint)(_pos + source.Length) > (uint)_span.Length) 113if ((uint)(pos + length) <= (uint)span.Length) 137Debug.Assert(_pos == _span.Length); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 215int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _pos + additionalCapacityBeyondPos); 225nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (1)
41for (int i = 0; i < numbers.Length; ++i)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Uri.cs (2)
4358while ((uint)i < (uint)chars.Length) 4360if (chars[i] == '%' && (uint)(i + 2) < (uint)chars.Length)
System\UriExt.cs (2)
549if (destination.Length < indexOfFirstToUnescape) 578if (destination.Length >= newLength)
System\UriHelper.cs (11)
19Debug.Assert(charsWritten == buffer.Length); 136if (destination.Length < charsToEscape.Length) 172if (destination.Length >= newLength) 612Debug.Assert(buffer.Length == destIndex); 639for (int i = span.Length - 1; i >= 0; i--) 675|| (lastSlash == 0 && i + dotCount + 1 == span.Length)) // "/..." 725if (lastSlash == dotCount || (lastSlash == 0 && dotCount == span.Length)) 735return span.Length; 748Debug.Assert(start >= readOffset && length > 0 && start + length <= span.Length); 762if (readOffset != span.Length) 767writeOffset += span.Length - readOffset;
System\ValueStringBuilderExtensions.cs (2)
15if ((uint)(pos + 1) < (uint)chars.Length && (uint)pos < (uint)chars.Length)
System.Private.Windows.Core (109)
_generated\130\Windows.Win32.IDispatch.g.cs (2)
103 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 104 winmdroot.Foundation.HRESULT __result = this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\131\Windows.Win32.IDispatchEx.g.cs (2)
86 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 87 winmdroot.Foundation.HRESULT __result = this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\140\Windows.Win32.IEnumFORMATETC.g.cs (2)
64 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 75 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\142\Windows.Win32.IEnumSTATDATA.g.cs (2)
64 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 75 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\143\Windows.Win32.IEnumSTATSTG.g.cs (2)
64 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 75 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\144\Windows.Win32.IEnumString.g.cs (2)
64 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 75 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\157\Windows.Win32.IPictureDisp.g.cs (2)
87 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 88 winmdroot.Foundation.HRESULT __result = this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\160\Windows.Win32.ISequentialStream.g.cs (2)
64 winmdroot.Foundation.HRESULT __result = this.Read((void* )pvLocal, (uint )pv.Length, pcbReadLocal); 75 winmdroot.Foundation.HRESULT __result = this.Read((void* )pvLocal, (uint )pv.Length, default(uint* ));
_generated\163\Windows.Win32.IStream.g.cs (2)
64 winmdroot.Foundation.HRESULT __result = this.Read((void* )pvLocal, (uint )pv.Length, pcbReadLocal); 75 winmdroot.Foundation.HRESULT __result = this.Read((void* )pvLocal, (uint )pv.Length, default(uint* ));
_generated\165\Windows.Win32.ITypeInfo.g.cs (3)
226 winmdroot.Foundation.HRESULT __result = this.GetNames(memid, rgBstrNamesLocal, (uint )rgBstrNames.Length, pcNamesLocal); 368 if (!rgszNames.IsEmpty && !pMemId.IsEmpty && rgszNames.Length != pMemId.Length) throw new ArgumentException(); 369 winmdroot.Foundation.HRESULT __result = this.GetIDsOfNames(rgszNamesLocal, (uint )(pMemId.IsEmpty ? rgszNames.Length : pMemId.Length), pMemIdLocal);
_generated\200\Windows.Win32.PInvokeCore.GDI32.dll.g.cs (4)
464 uint __result = PInvokeCore.GetEnhMetaFileBits(hEMF, (uint )lpData.Length, (byte* )lpDataLocal); 490 int __result = PInvokeCore.GetObject(h, pv.Length, (void* )pvLocal); 526 uint __result = PInvokeCore.GetPaletteEntries(hpal, iStart, (uint )pPalEntries.Length, pPalEntriesLocal); 553 uint __result = PInvokeCore.GetRegionData(hrgn, (uint )lpRgnData.Length, (winmdroot.Graphics.Gdi.RGNDATA* )lpRgnDataLocal);
_generated\202\Windows.Win32.PInvokeCore.KERNEL32.dll.g.cs (1)
255 int __result = PInvokeCore.MultiByteToWideChar(CodePage, dwFlags, new winmdroot.Foundation.PCSTR (lpMultiByteStrLocal), cbMultiByte, lpWideCharStrLocal, lpWideCharStr.Length);
_generated\205\Windows.Win32.PInvokeCore.SHELL32.dll.g.cs (1)
46 uint __result = PInvokeCore.DragQueryFile(hDrop, iFile, lpszFileLocal, (uint )lpszFile.Length);
_generated\206\Windows.Win32.PInvokeCore.USER32.dll.g.cs (2)
403 int __result = PInvokeCore.GetClipboardFormatName(format, lpszFormatNameLocal, lpszFormatName.Length); 682 int __result = PInvokeCore.GetWindowText(hWnd, lpStringLocal, lpString.Length);
_generated\239\Windows.Win32.System_Com_IEnumFORMATETC_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\241\Windows.Win32.System_Com_IEnumSTATDATA_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\242\Windows.Win32.System_Com_IEnumString_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\249\Windows.Win32.System_Com_ISequentialStream_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Read((void* )pvLocal, (uint )pv.Length, pcbReadLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Read((void* )pvLocal, (uint )pv.Length, default(uint* ));
_generated\251\Windows.Win32.System_Com_IStream_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Read((void* )pvLocal, (uint )pv.Length, pcbReadLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Read((void* )pvLocal, (uint )pv.Length, default(uint* ));
_generated\253\Windows.Win32.System_Com_ITypeInfo_Extensions.g.cs (3)
61 winmdroot.Foundation.HRESULT __result = @this.GetNames(memid, rgBstrNamesLocal, (uint )rgBstrNames.Length, pcNamesLocal); 95 if (!rgszNames.IsEmpty && !pMemId.IsEmpty && rgszNames.Length != pMemId.Length) throw new ArgumentException(); 96 winmdroot.Foundation.HRESULT __result = @this.GetIDsOfNames(rgszNamesLocal, (uint )(pMemId.IsEmpty ? rgszNames.Length : pMemId.Length), pMemIdLocal);
_generated\255\Windows.Win32.System_Com_StructuredStorage_IEnumSTATSTG_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
System\BufferScope.cs (3)
59if (initialBuffer.Length >= minimumLength) 83if (_span!.Length >= capacity) 111public readonly int Length => _span.Length;
System\IO\BinaryReaderExtensions.cs (1)
124if (reader.Read(arrayData) != arrayData.Length)
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
324uint charactersCopied = PInvokeCore.DragQueryFile(hdrop, i, buffer, (uint)fileName.Length);
System\SpanHelpers.cs (2)
17if (source.Length >= destination.Length) 19source = source[..(destination.Length - 1)];
System\SpanWriter.cs (11)
16readonly get => Span.Length - _unwritten.Length; 20public readonly int Length => Span.Length; 46if (_unwritten.Length >= values.Length) 63if (_unwritten.Length >= count) 82public void Rewind(int count) => _unwritten = Span[(Span.Length - _unwritten.Length - count)..]; 92Debug.Assert((uint)count <= (uint)_unwritten.Length); 93UncheckedSlice(ref _unwritten, count, _unwritten.Length - count); 99Debug.Assert((uint)start <= (uint)span.Length && (uint)length <= (uint)(span.Length - start));
System\Text\ValueStringBuilder.cs (15)
52Debug.Assert(value <= _chars.Length); 57public readonly int Capacity => _chars.Length; 65if ((uint)capacity > (uint)_chars.Length) 155if (_pos > _chars.Length - count) 175if (_pos > (_chars.Length - count)) 190if ((uint)pos < (uint)_chars.Length) 216if (s.Length == 1 && (uint)pos < (uint)_chars.Length) 231if (pos > _chars.Length - s.Length) 260if (_pos > _chars.Length - count) 266for (int i = 0; i < dst.Length; i++) 277if (pos > _chars.Length - length) 283for (int i = 0; i < dst.Length; i++) 294if (pos > _chars.Length - value.Length) 322Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 330Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
Windows\Win32\Graphics\Gdi\ArgbBuffer.cs (2)
29public ArgbBuffer(Span<Color> colors) : this(colors.Length) 31for (int i = 0; i < colors.Length; i++)
Windows\Win32\PInvokeCore.GetPaletteEntries.cs (1)
13return GetPaletteEntries(hpal, 0, (uint)entries.Length, entry);
Windows\Win32\System\Com\ComInterfaceTable.cs (8)
25Count = entries.Length 43Count = entries.Length 63Count = entries.Length 85Count = entries.Length 109Count = entries.Length 135Count = entries.Length 169Count = entries.Length 239Count = entries.Length
Windows\Win32\System\Variant\VARIANT.cs (21)
338for (int i = 0; i < data.Length; i++) 350for (int i = 0; i < data.Length; i++) 362for (int i = 0; i < data.Length; i++) 374for (int i = 0; i < data.Length; i++) 386for (int i = 0; i < data.Length; i++) 399for (int i = 0; i < data.Length; i++) 411for (int i = 0; i < data.Length; i++) 769bool[] result = new bool[data.Length]; 770for (int i = 0; i < data.Length; i++) 796decimal[] result = new decimal[data.Length]; 797for (int i = 0; i < data.Length; i++) 808var result = new DateTime[data.Length]; 809for (int i = 0; i < data.Length; i++) 820var result = new DateTime[data.Length]; 821for (int i = 0; i < data.Length; i++) 835string?[] result = new string?[data.Length]; 836for (int i = 0; i < data.Length; i++) 847string?[] result = new string?[data.Length]; 848for (int i = 0; i < data.Length; i++) 859object?[] result = new object?[data.Length]; 860for (int i = 0; i < data.Length; i++)
System.Private.Windows.GdiPlus (9)
_generated\60\Windows.Win32.PInvokeGdiPlus.gdiplus.dll.g.cs (9)
3899 winmdroot.Graphics.GdiPlus.Status __result = PInvokeGdiPlus.GdipGetImageDecoders(numDecoders, (uint )decoders.Length, (winmdroot.Graphics.GdiPlus.ImageCodecInfo* )decodersLocal); 3956 winmdroot.Graphics.GdiPlus.Status __result = PInvokeGdiPlus.GdipGetImageEncoders(numEncoders, (uint )encoders.Length, (winmdroot.Graphics.GdiPlus.ImageCodecInfo* )encodersLocal); 4840 winmdroot.Graphics.GdiPlus.Status __result = PInvokeGdiPlus.GdipGetPathTypes(pathLocal, (byte* )typesLocal, types.Length); 5346 winmdroot.Graphics.GdiPlus.Status __result = PInvokeGdiPlus.GdipGetRegionData(regionLocal, bufferLocal, (uint )buffer.Length, sizeFilledLocal); 5360 winmdroot.Graphics.GdiPlus.Status __result = PInvokeGdiPlus.GdipGetRegionData(regionLocal, bufferLocal, (uint )buffer.Length, default(uint* )); 6497 if (!points.IsEmpty && !types.IsEmpty && points.Length != types.Length) throw new ArgumentException(); 6498 winmdroot.Graphics.GdiPlus.Status __result = PInvokeGdiPlus.GdipPathIterEnumerate(iteratorLocal, resultCountLocal, pointsLocal, typesLocal, (types.IsEmpty ? points.Length : types.Length));
System.Private.Xml (28)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Xml\Base64Decoder.cs (2)
125if ((uint)iByte >= (uint)bytes.Length) 159if (iByte == bytes.Length)
System\Xml\BinaryXml\XmlBinaryReader.cs (1)
2333int cch = dstChars.Length;
System\Xml\BinHexDecoder.cs (1)
146if ((uint)iByte >= (uint)bytes.Length)
System\Xml\Schema\XsdDateTime.cs (1)
580return destination.Length >= vsb.Length;
System\Xml\Schema\XsdDuration.cs (1)
444return destination.Length >= vsb.Length;
System\Xml\XmlConvert.cs (1)
1650if (destination.Length < 1) return false;
System\Xml\Xsl\Runtime\XslNumber.cs (1)
343for (int newPos = result.Length - 1; newPos >= 0; newPos--)
System.Reflection.Metadata (22)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (2)
256if (parts.Length is < 2 or > 4) 262for (int i = 0; i < parts.Length; i++)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System.Runtime.InteropServices.JavaScript (4)
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Byte.cs (1)
169slot.Length = value.Length;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Double.cs (1)
175slot.Length = value.Length;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Int32.cs (1)
169slot.Length = value.Length;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Single.cs (1)
175slot.Length = value.Length;
System.Runtime.Numerics (262)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (12)
32Debug.Assert(value <= _span.Length); 53if ((uint)pos < (uint)span.Length) 69if (source.Length == 1 && (uint)pos < (uint)span.Length) 83if ((uint)(_pos + source.Length) > (uint)_span.Length) 96if ((uint)(_pos + source.Length) > (uint)_span.Length) 113if ((uint)(pos + length) <= (uint)span.Length) 137Debug.Assert(_pos == _span.Length); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 215int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _pos + additionalCapacityBeyondPos); 225nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (4)
236Debug.Assert(destination.Length >= 2); 680if (thousandsSepCtr >= thousandsSepPos.Length) 682var newThousandsSepPos = new int[thousandsSepPos.Length * 2]; 1022for (int j = 0; j < groupBuffer.Length; j++)
src\runtime\src\libraries\Common\src\System\Number.NumberBuffer.cs (3)
63for (numDigits = 0; numDigits < Digits.Length; numDigits++) 76Debug.Assert(numDigits < Digits.Length, "Null terminator not found in Number"); 91for (int i = 0; i < Digits.Length; i++)
src\runtime\src\libraries\Common\src\System\Number.Parsing.Common.cs (1)
104int maxDigCount = number.Digits.Length - 1;
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder_1.cs (13)
45Debug.Assert(value <= _chars.Length); 50public readonly int Capacity => _chars.Length; 58if ((uint)capacity > (uint)_chars.Length) 161if (_pos > _chars.Length - count) 181if (_pos > (_chars.Length - count)) 197if ((uint)pos < (uint)chars.Length) 217if (text.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 231if (pos > _chars.Length - text.Length) 242if (_pos > _chars.Length - count) 248for (int i = 0; i < dst.Length; i++) 259if (origPos > _chars.Length - length) 287Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 295Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BigIntegerCalculator.Shared.cs (26)
197Debug.Assert(result.Length >= left.Length); 248Debug.Assert(result.Length >= left.Length); 303Debug.Assert(result.Length >= right.Length); 384Debug.Assert(bits.Length == left.Length + 1); 393Debug.Assert(bits.Length == left.Length + 1); 412Debug.Assert(left.Length >= right.Length); 427for (; carry != 0 && i < left.Length; i++) 441Debug.Assert(bits.Length == left.Length); 451Debug.Assert(bits.Length == left.Length); 468Debug.Assert(left.Length >= right.Length); 483for (; borrow != 0 && i < left.Length; i++) 595Debug.Assert(right.IsEmpty || bits.Length >= left.Length + right.Length); 613Debug.Assert(left.Length >= 1); 615Debug.Assert(left.Length >= right.Length); 617quotient.Length == 0 618|| quotient.Length == left.Length - right.Length + 1 619|| (CompareActual(left.Slice(left.Length - right.Length), right) < 0 && quotient.Length == left.Length - right.Length)); 644for (int i = left.Length; i >= right.Length; i--) 647nuint t = (uint)i < (uint)left.Length ? left[i] : 0; 690if ((uint)n < (uint)quotient.Length) 695if ((uint)i < (uint)left.Length) 704Debug.Assert(left.Length >= right.Length); 721Debug.Assert(left.Length >= right.Length);
System\Number.BigInteger.cs (19)
494Debug.Assert(bits.Trim((nuint)0).Length == 0); 595for (int i = 0; i < bits.Length; i++) 604for (int i = 0; i < bits.Length; i++) 635int cur = bits.Length - 1; 722long tmpCharCount = charsInHighByte + ((long)(bytes.Length - 1) << 3); 741if (charsIncludeDigits > destination.Length) 772for (int i = bytes.Length - 2; i >= 0; i--) 890if (destination.Length < strLength) 996int pos = destination.Length; 1375Debug.Assert(pow1E9.Length >= 1); 1377if (pow1E9.Length <= LeadingPowers1E9.Length) 1391if (pow1E9.Length - toExclusive < (src.Length << 1)) 1407dst.Slice(dst.Length - shift).Clear(); 1413Debug.Assert(toExclusive == pow1E9.Length || pow1E9[toExclusive] == 0); 1484Span<nuint> powersOfTen = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer powersOfTenBuffer); 1544for (int i = 0; i < bits2.Length; i++) 1553for (int i = 0; i < bits2.Length; i++) 1604Debug.Assert(destination.Length * TParser.DigitsPerBlock == input.Length); 1606for (int i = 0; i < destination.Length; i++)
System\Numerics\BigInteger.cs (19)
258Debug.Assert(bits.Length == 4 && (bits[3] & DecimalScaleFactorMask) == 0); 582if ((value.Length > 0) && ((nint)value[^1] < 0)) 603if (value.Length > MaxLength) 608if (value.Length == 0) 613else if (value.Length == 1) 1551if (destination.Length != 0) 1648if (destination.Length < length) 1746Debug.Assert(_bits is null || _sign == 0 ? buffer.Length == 2 : buffer.Length >= _bits.Length + 1); 1761NumericsHelpers.DangerousMakeTwosComplement(buffer.Slice(0, buffer.Length - 1)); // Mutates limbs 2908Debug.Assert((uint)leastSignificant < (uint)zd.Length); 3587nuintDigitShift %= zd.Length; 3596nuintDigitShift %= zd.Length; 3598BigIntegerCalculator.SwapUpperAndLower(zd, zd.Length - nuintDigitShift); 3692for (int i = 0; i < limbs.Length; i++) 3723Debug.Assert((uint)leadingZeroCount < (uint)zd.Length); 3834if (destination.Length >= byteCount) 3912if (destination.Length >= byteCount) 5492if ((uint)negLeadingZeroCount < (uint)zd.Length) // is equivalent to negLeadingZeroCount >= 0 && negLeadingZeroCount < zd.Length
System\Numerics\BigIntegerCalculator.Bitwise.cs (1)
57for (int i = 0; i < result.Length; i++)
System\Numerics\BigIntegerCalculator.DivRem.cs (49)
36Debug.Assert(quotient.Length == left.Length); 69Debug.Assert(quotient.Length == left.Length - right.Length + 1); 70Debug.Assert(remainder.Length == left.Length); 90Debug.Assert(quotient.Length == left.Length - right.Length + 1); 117Debug.Assert(remainder.Length == left.Length); 148Debug.Assert(left.Length >= 1); 150Debug.Assert(left.Length >= right.Length); 151Debug.Assert(quotient.Length == left.Length - right.Length + 1 152|| quotient.Length == 0); 155if (right.Length < DivideBurnikelZieglerThreshold || left.Length - right.Length < DivideBurnikelZieglerThreshold) 163Span<nuint> leftCopy = BigInteger.RentedBuffer.Create(left.Length, out BigInteger.RentedBuffer leftCopyBuffer); 166int quotientLength = quotient.Length > 0 ? 0 : left.Length - right.Length + 1; 168Span<nuint> quotientActual = quotient.Length > 0 ? quotient : quotientAllocated; 182Debug.Assert(quotient.Length == left.Length - right.Length + 1); 183Debug.Assert(remainder.Length == left.Length || remainder.Length == 0); 218Debug.Assert(src.Length + sigmaDigit <= bits.Length); 231for (int i = 0; i < bits.Length; i++) 246int t = Math.Max(2, (a.Length + n - 1) / n); // Max(2, Ceil(a.Length/n)) 247Debug.Assert(t < a.Length || (t == a.Length && (nint)a[^1] >= 0)); 253z.Slice(a.Length - (t - 2) * n).Clear(); 256if (quotientUpper.Length < n) 262Debug.Assert(!q.Slice(quotientUpper.Length).ContainsAnyExcept(0u)); 263q.Slice(0, quotientUpper.Length).CopyTo(quotientUpper); 288if (remainder.Length != 0) 291remainder.Slice(rt.Length).Clear(); 301for (int i = rt.Length - 1; i >= 0; i--) 325Debug.Assert(quotient.Length == right.Length); 326Debug.Assert(remainder.Length >= right.Length + 1); 342if (quotient.Length < left.Length) 344Debug.Assert(quotient.Length + 1 == left.Length); 348DivideCore(left.Slice(0, quotient.Length), right[0], quotient, ref carry); 357if (remainder.Length != 0) 368int quotientLength = Math.Min(left.Length - right.Length + 1, quotient.Length); 373if (r1.Length < remainder.Length) 375remainder.Slice(r1.Length).Clear(); 380Debug.Assert(!r1.Slice(remainder.Length).ContainsAnyExcept(0u)); 381r1.Slice(0, remainder.Length).CopyTo(remainder); 393Debug.Assert(quotient.Length == right.Length); 394Debug.Assert(remainder.Length >= right.Length + 1); 419Debug.Assert(2 * quotient.Length == right.Length); 420Debug.Assert(remainder.Length >= right.Length + 1); 455Span<nuint> rr = remainder.Slice(0, d.Length + 1); 462Debug.Assert((uint)qi < (uint)quotient.Length); 473Debug.Assert(bits.Length == left.Length + right.Length);
System\Numerics\BigIntegerCalculator.FastReducer.cs (13)
26Debug.Assert(r.Length == modulus.Length * 2 + 1); 27Debug.Assert(mu.Length == r.Length - modulus.Length + 1); 28Debug.Assert(q1.Length == modulus.Length * 2 + 2); 29Debug.Assert(q2.Length == modulus.Length * 2 + 2); 47Debug.Assert(value.Length <= _modulus.Length * 2); 50if (value.Length < _modulus.Length) 52return value.Length; 75Debug.Assert(bits.Length + k >= left.Length + right.Length); 102if (left.Length > k) 118Debug.Assert(left.Length >= right.Length); 133for (; borrow != 0 && i < left.Length; i++) 149return left.Length;
System\Numerics\BigIntegerCalculator.GcdInv.cs (19)
93Debug.Assert(result.Length == left.Length); 107Debug.Assert(left.Length >= 2); 108Debug.Assert(right.Length >= 2); 109Debug.Assert(left.Length >= right.Length); 120while (right.Length > (nint.Size == 4 ? 2 : 1)) 219if (right.Length > 0) 231if (right.Length > 1) 254Debug.Assert(buffer.Length >= 2); 256if (buffer.Length > 2) 271Debug.Assert(buffer.Length >= 1); 273if (buffer.Length > 1) 390Debug.Assert(x.Length >= 1); 391Debug.Assert(y.Length >= 1); 392Debug.Assert(x.Length >= y.Length); 398int length = y.Length; 455Debug.Assert(bits.Length >= maxLength); 457if (bits.Length > maxLength)
System\Numerics\BigIntegerCalculator.PowMod.cs (25)
23Debug.Assert(bits.Length == PowBound(power, value.Length)); 25Span<nuint> temp = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer tempBuffer); 27Span<nuint> valueCopy = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer valueCopyBuffer); 33bits.Slice(result.Length).Clear(); 41Debug.Assert(value.Length >= valueLength); 42Debug.Assert(temp.Length == result.Length); 43Debug.Assert(value.Length == temp.Length); 69Debug.Assert(leftLength <= left.Length); 86Debug.Assert(valueLength <= value.Length); 87Debug.Assert(temp.Length >= valueLength + valueLength); 261Debug.Assert(bits.Length == modulus.Length + modulus.Length); 266int size = Math.Max(value.Length, bits.Length); 283Span<nuint> temp = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer tempBuffer); 301Debug.Assert(bits.Length == modulus.Length + modulus.Length); 306int size = Math.Max(value.Length, bits.Length); 323Span<nuint> temp = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer tempBuffer); 355bits.Slice(result.Length).Clear(); 379bits.Slice(result.Length).Clear(); 394size = r.Length - modulus.Length + 1; 408bits.Slice(result.Length).Clear(); 483Debug.Assert(bits.Length >= modulus.Length * 2); 499if (shifted.Length >= modulus.Length) 679Debug.Assert(value.Length >= 2 * k);
System\Numerics\BigIntegerCalculator.ShiftRot.cs (16)
28RotateRight(bits, digitShift % bits.Length, smallShift); 37RotateLeft(bits, digitShift % bits.Length, smallShift); 43Debug.Assert(bits.Length > 0); 53SwapUpperAndLower(bits, bits.Length - digitShift); 58Debug.Assert(bits.Length > 0); 74Debug.Assert(lowerLength < bits.Length); 76int upperLength = bits.Length - lowerLength; 109Debug.Assert(lowerLength < bits.Length); 111int upperLength = bits.Length - lowerLength; 157int offset = bits.Length; 205for (int i = 0; i < bits.Length; i++) 230while (Vector512.IsHardwareAccelerated && remaining.Length >= Vector512<nuint>.Count + 1) 241while (Vector256.IsHardwareAccelerated && remaining.Length >= Vector256<nuint>.Count + 1) 252while (Vector128.IsHardwareAccelerated && remaining.Length >= Vector128<nuint>.Count + 1) 263for (int i = 0; i < remaining.Length - 1; i++) 267remaining[remaining.Length - 1] >>= shift;
System\Numerics\BigIntegerCalculator.SquMul.cs (29)
29Debug.Assert(bits.Length == value.Length + value.Length); 57Debug.Assert(bits.Length >= value.Length + value.Length); 94Debug.Assert(bits.Length == value.Length + value.Length); 146Debug.Assert(bits.Length == value.Length + value.Length); 206Debug.Assert(bits.Length == left.Length + 1); 224Debug.Assert(right.IsEmpty || bits.Length >= left.Length + right.Length); 260Debug.Assert(bits.Length >= left.Length + right.Length); 309Debug.Assert(bits.Length >= left.Length + right.Length); 370Span<nuint> c1 = z1.Slice(0, p1.Length + q1.Length); 373Span<nuint> cm1 = cAll.Slice(cLength * 2, pm1.Length + qm1.Length); 422Debug.Assert(bits.Length >= left.Length + right.Length); 443Debug.Assert(bitsLow.Length >= bitsHigh.Length); 488Debug.Assert(bits.Length >= left.Length + right.Length); 540Debug.Assert(buffer.Length == 3 * (n + 1)); 779if (bits.Length >= 3 * n) 803for (int i = bits.Length - 1; i >= 0; i--) 848Debug.Assert(core.Length >= left.Length); 883for (; carry != 0 && i < core.Length; i++) 908for (; carry != 0 && i < core.Length; i++) 920Debug.Assert(left.Length >= right.Length); 938Debug.Assert(left.Length >= right.Length); 972for (int j = 0; j < left.Length; j++) 984Debug.Assert(left.Length >= right.Length); 1016for (int j = 0; j < left.Length; j++) 1029for (int i = 0; i < bits.Length; i++) 1040for (int i = bits.Length - 1; i >= 0; i--)
System\Numerics\BigIntegerCalculator.Utils.cs (2)
14if (bits.Length >= modulus.Length) 21return bits.Length;
System\Numerics\Complex.cs (3)
879if (destination.Length >= 6) 889if (destination.Length >= 4) 896if ((uint)(2 + imaginaryChars) < (uint)destination.Length)
System\Numerics\Complex.Generic.cs (3)
2085if (destination.Length >= 6) 2095if (destination.Length >= 4) 2102if ((uint)(2 + imaginaryChars) < (uint)destination.Length)
System\Numerics\NumericsHelpers.cs (5)
53if ((uint)i >= (uint)d.Length) 80while (Vector512.IsHardwareAccelerated && d.Length >= Vector512<nuint>.Count) 87while (Vector256.IsHardwareAccelerated && d.Length >= Vector256<nuint>.Count) 94while (Vector128.IsHardwareAccelerated && d.Length >= Vector128<nuint>.Count) 101for (int i = 0; i < d.Length; i++)
System.Security.Cryptography (375)
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.CryptGetProvParam.cs (1)
64if (dwDataLen > pbData.Length)
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptDecapsulateEncapsulate.cs (3)
49(uint)secretKey.Length, 76(uint)secretKey.Length, 79(uint)cipherText.Length,
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptDeriveKey.cs (1)
38(uint)destination.Length,
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptEncryptDecrypt.cs (2)
23NTSTATUS ntStatus = BCryptEncrypt(hKey, pbInput, input.Length, IntPtr.Zero, iv, iv == null ? 0 : iv.Length, pbOutput, output.Length, out cbResult, 0); 44NTSTATUS ntStatus = BCryptDecrypt(hKey, pbInput, input.Length, IntPtr.Zero, iv, iv == null ? 0 : iv.Length, pbOutput, output.Length, out cbResult, 0);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptEncryptDecrypt.RSA.cs (3)
83destination.Length, 118destination.Length, 124if (status == NTSTATUS.STATUS_SUCCESS && written > destination.Length)
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptSignHash.cs (6)
47destination.Length, 74destination.Length, 103destination.Length, 113Debug.Assert(bytesWritten <= destination.Length); 144destination.Length, 149Debug.Assert(bytesWritten == destination.Length);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
47int length = FormatMessage(flags, moduleHandle, unchecked((uint)errorCode), 0, bufferPtr, stackBuffer.Length, IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.NCryptDecapsulateEncapsulate.cs (3)
50(uint)secretKey.Length, 77(uint)secretKey.Length, 80(uint)cipherText.Length,
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.NCryptDeriveKeyMaterial.cs (1)
304destination.Length,
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.SignVerify.cs (1)
22return NCryptSignHash(hKey, pPaddingInfo, pHash, pbHashValue.Length, pSignature, pbSignature.Length, out pcbResult, dwFlags);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AeadCommon.Windows.cs (3)
32authInfo.cbTag = tag.Length; 44ciphertext.Length, 89plaintext.Length,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (5)
64Debug.Assert(destination.Length >= encodedSize); 87if (signatureField.Length > response.Length) 89if (signatureField.Length != response.Length + 1 || 94Debug.Fail($"A signature field was longer ({signatureField.Length}) than expected ({response.Length})"); 103int writeOffset = response.Length - signatureField.Length;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (7)
193empty.Length, 202if (written > destination.Length) 214destination.Length, 246pbeParams.Params.cbSalt = salt.Length; 306else if (numBytesNeeded > destination.Length) 318destination.Length, 327if (allocate && numBytesNeeded != destination.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.SignVerify.cs (2)
66Debug.Assert(numBytesNeeded == destination.Length); 85Debug.Assert(bytesWritten <= signature.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngPkcs8.cs (3)
412Debug.Assert(destination.Length < 128); 413Span<byte> randomKey = stackalloc byte[destination.Length]; 416for (int i = 0; i < randomKey.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (8)
216if (destination.Length < Algorithm.MaxSignatureSizeInBytes) 1396if (destination.Length < minimumPossiblePkcs8Key) 1550if (destination.Length < Algorithm.MinPublicKeySizeInBytes) 1587if (destination.Length < Algorithm.MinPublicKeySizeInBytes) 1605if (localBytesWritten > destination.Length) 1675if (destination.Length < Algorithm.MinPrivateKeySizeInBytes) 1712if (destination.Length < Algorithm.MinPrivateKeySizeInBytes) 1735if (localBytesWritten > destination.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaCng.Windows.cs (3)
144Debug.Fail($"Private key size too large for buffer: {privateKey.Length} / {destination.Length}"); 170if (destination.Length < pkcs8.Count) 223$"{nameof(keyBytes)}.Length: {keyBytes.Length} / {destination.Length}");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaImplementation.Windows.cs (2)
175keyBytes.Length > destination.Length || 181$"{nameof(keyBytes)}.Length: {keyBytes.Length} / {destination.Length}");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLKem.cs (11)
170if (ciphertext.Length != Algorithm.CiphertextSizeInBytes) 177if (sharedSecret.Length != Algorithm.SharedSecretSizeInBytes) 280if (sharedSecret.Length != Algorithm.SharedSecretSizeInBytes) 1665if (destination.Length < minimumPossiblePkcs8Key) 1819if (destination.Length < Algorithm.MinEncapsulationKeySizeInBytes) 1856if (destination.Length < Algorithm.MinEncapsulationKeySizeInBytes) 1874if (localBytesWritten > destination.Length) 1962if (destination.Length < Algorithm.MinDecapsulationKeySizeInBytes) 2001if (destination.Length < Algorithm.MinDecapsulationKeySizeInBytes) 2024if (localBytesWritten > destination.Length) 2223if ((uint)written > (uint)lease.Span.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (2)
57Return(_skipClear ? 0 : Span.Length); 114if (currentBuffer.Length >= length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.SignVerify.cs (1)
114Debug.Assert(stackBuf.Length == WindowsMaxQSize);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
282if (destination.Length != expectedLength)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (2)
33int length = destination.Length; 55destination.Slice(0, destination.Length - span.Length).Clear();
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (1)
787if (destination.Length < minimumPossiblePkcs8MLDsaKey)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaCng.Windows.cs (1)
224if (destination.Length < pkcs8.Count)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.Windows.cs (2)
49if (written != destination.Length) 51Debug.Fail($"Expected {destination.Length} bytes, but {nameof(Interop.BCrypt.BCryptSignHashPqcPure)} wrote {written} bytes.");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaPkcs8.cs (2)
35written = buffer.Length; 44written = buffer.Length;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (7)
111if (ciphertext.Length != Algorithm.CiphertextSizeInBytes) 118if (sharedSecret.Length != Algorithm.SharedSecretSizeInBytes) 208if (sharedSecret.Length != Algorithm.SharedSecretSizeInBytes) 291if (destination.Length != Algorithm.PrivateSeedSizeInBytes) 522if (destination.Length != Algorithm.DecapsulationKeySizeInBytes) 576if (destination.Length != Algorithm.EncapsulationKeySizeInBytes) 709if (destination.Length < MinimumPossiblePkcs8MLKemKey)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.Windows.cs (1)
32if (keySize != destination.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemCng.Windows.cs (9)
97Debug.Assert(sharedSecret.Length == Algorithm.SharedSecretSizeInBytes); 102Debug.Assert(written == (uint)sharedSecret.Length); 110Debug.Assert(ciphertext.Length == Algorithm.CiphertextSizeInBytes); 111Debug.Assert(sharedSecret.Length == Algorithm.SharedSecretSizeInBytes); 123Debug.Assert(sharedSecretWritten == (uint)sharedSecret.Length); 124Debug.Assert(ciphertextWritten == (uint)ciphertext.Length); 132Debug.Assert(destination.Length == Algorithm.PrivateSeedSizeInBytes); 148Debug.Assert(destination.Length == Algorithm.DecapsulationKeySizeInBytes); 164Debug.Assert(destination.Length == Algorithm.EncapsulationKeySizeInBytes);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.Windows.cs (9)
83Debug.Assert(sharedSecret.Length == Algorithm.SharedSecretSizeInBytes); 88Debug.Assert(written == (uint)sharedSecret.Length); 94Debug.Assert(ciphertext.Length == Algorithm.CiphertextSizeInBytes); 95Debug.Assert(sharedSecret.Length == Algorithm.SharedSecretSizeInBytes); 103Debug.Assert(sharedSecretWritten == (uint)sharedSecret.Length); 104Debug.Assert(ciphertextWritten == (uint)ciphertext.Length); 109Debug.Assert(destination.Length == Algorithm.PrivateSeedSizeInBytes); 117Debug.Assert(destination.Length == Algorithm.DecapsulationKeySizeInBytes); 125Debug.Assert(destination.Length == Algorithm.EncapsulationKeySizeInBytes);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemPkcs8.cs (2)
35written = buffer.Length; 44written = buffer.Length;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (10)
103Debug.Assert(destination.Length >= encryptedData.Length); 213if (byteCount > buf.Length) 229Debug.Assert(written == buf.Length); 498if (byteCount > buf.Length) 514Debug.Assert(written == buf.Length); 531CryptoPool.Return(rented, buf.Length); 967byte[] rentedDestination = CryptoPool.Rent(destination.Length); 1013CryptoPool.Return(rentedDestination, destination.Length); 1048if (!hasher.TryGetHashAndReset(t, out tLength) || tLength != t.Length) 1056t.Slice(0, dk.Length).CopyTo(dk);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (3)
212if (!mac.TryGetHashAndReset(macSpan, out int bytesWritten) || bytesWritten != macSpan.Length) 214Debug.Fail($"TryGetHashAndReset wrote {bytesWritten} of {macSpan.Length} bytes"); 356if (destination.Length < _sealedData.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (20)
183if (!hash.TryGetHashAndReset(hashBuf, out int bytesWritten) || bytesWritten != hashBuf.Length) 185Debug.Fail($"Hash output wrote {bytesWritten} bytes when {hashBuf.Length} was expected"); 200if (hashBuf.Length >= destination.Length) 202hashBuf.Slice(0, destination.Length).CopyTo(destination); 207destination = destination.Slice(hashBuf.Length); 216for (int j = (I.Length / vBytes) - 1; j >= 0; j--) 238Debug.Assert(into.Length == addend.Length); 242for (int i = into.Length - 1; i >= 0; i--) 254while (destination.Length > 0) 256if (destination.Length >= bytes.Length) 263bytes.Slice(0, destination.Length).CopyTo(destination); 273Debug.Assert(destination.Length % 2 == 0); 275while (destination.Length > 0) 277if (destination.Length >= fullCopyLen) 288Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length)); 290destination = destination.Slice(nullTerminator.Length); 294ReadOnlySpan<char> trimmed = password.Slice(0, destination.Length / 2); 298if (count != destination.Length) 300Debug.Fail($"Partial copy wrote {count} bytes of {destination.Length} expected");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PqcBlobHelpers.cs (1)
227Debug.Assert(index == blobBytes.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (3)
290Interop.NCrypt.NCryptEncrypt(key, input, input.Length, paddingInfo, output, output.Length, out bytesNeeded, paddingMode) : 291Interop.NCrypt.NCryptDecrypt(key, input, input.Length, paddingInfo, output, output.Length, out bytesNeeded, paddingMode); 294if (errorCode == ErrorCode.ERROR_SUCCESS && bytesNeeded > output.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (22)
125int k = destination.Length; 134Span<byte> mInEM = destination.Slice(destination.Length - source.Length); 135Span<byte> ps = destination.Slice(2, destination.Length - source.Length - 3); 138destination[ps.Length + 2] = 0; 157int spaceRemain = destination.Length - len; 161len = Choose(spaceRemainSign, destination.Length, len); 271if (destination.Length - 11 < tLen) 277int paddingLength = destination.Length - tLen - 3; 303int maxInput = checked(destination.Length - hLen - hLen - 2); 325Span<byte> mDest = db.Slice(db.Length - source.Length); 326Span<byte> ps = db.Slice(hLen, db.Length - hLen - 1 - mDest.Length); 327Span<byte> psEnd = db.Slice(hLen + ps.Length, 1); 349dbMask = CryptoPool.Rent(db.Length); 350dbMaskSpan = new Span<byte>(dbMask, 0, db.Length); 410destination.Slice(0, destination.Length - emLen).Clear(); 413Span<byte> em = destination.Slice(destination.Length - emLen, emLen); 557ReadOnlySpan<byte> salt = dbMask.Slice(dbMask.Length - sLen); 595while (writePtr.Length > 0) 601if (writePtr.Length >= hLen) 624tmp.Slice(0, writePtr.Length).CopyTo(writePtr); 637if (a.Length != b.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (5)
134if (destination.Length != signatureSizeInBytes) 318if (destination.Length != Algorithm.SignatureSizeInBytes) 622if (destination.Length < MinimumPossiblePkcs8SlhDsaKey) 1079if (destination.Length != publicKeySizeInBytes) 1130if (destination.Length != privateKeySizeInBytes)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdf.cs (4)
275CheckPrfOutputLength(destination.Length, nameof(destination)); 355CheckPrfOutputLength(destination.Length, nameof(destination)); 431CheckPrfOutputLength(destination.Length, nameof(destination)); 482CheckPrfOutputLength(destination.Length, nameof(destination));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationCng.cs (6)
36if (destination.Length == 0) 41Debug.Assert(destination.Length <= 0x1FFFFFFF); 71destination.Length, 80if (destination.Length != resultLength) 104Debug.Assert(destination.Length <= 0x1FFFFFFF); 119if (destination.Length == 0)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Utf8DataEncoding.cs (1)
18_buffer = (uint)maxLength <= stackBuffer.Length ?
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519DiffieHellman.cs (7)
149if (destination.Length != SecretAgreementSizeInBytes) 186if (destination.Length != SecretAgreementSizeInBytes) 250if (destination.Length != PrivateKeySizeInBytes) 295if (destination.Length != PublicKeySizeInBytes) 412if (destination.Length < MinimumPossiblePkcs8X25519Key) 1452if (destination.Length < SpkiSizeInBytes) 1530if (destination.Length < Pkcs8SizeInBytes)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519DiffieHellmanCng.Windows.cs (4)
55Debug.Assert(destination.Length == SecretAgreementSizeInBytes); 131Debug.Assert(destination.Length == PublicKeySizeInBytes); 137Debug.Assert(destination.Length == PrivateKeySizeInBytes); 205lease.Span.Length,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519DiffieHellmanImplementation.Windows.cs (2)
39Debug.Assert(destination.Length == SecretAgreementSizeInBytes); 60Debug.Assert(destination.Length == SecretAgreementSizeInBytes);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519WindowsHelpers.cs (2)
155Debug.Assert(reduced.Length == PublicKeySizeInBytes); 205Debug.Assert(key.Length == PublicKeySizeInBytes);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (2)
1261if (!mac.TryGetHashAndReset(macKey, out int bytesWritten) || bytesWritten != macKey.Length) 1263Debug.Fail($"TryGetHashAndReset wrote {bytesWritten} of {macKey.Length} bytes");
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Security\Cryptography\Aes.cs (13)
134if (destination.Length != requiredLength) 258if (destination.Length < requiredLength) 464if (destination.Length != requiredLength) 532/// <paramref name="destination"/> has a <see cref="Span{T}.Length"/> that is 590if (destination.Length < minOutput) 596if (destination.Length > maxOutput) 622if (written > destination.Length) 704Debug.Assert(written == decrypt.Length); 767Debug.Assert(destination.Length == GetKeyWrapPaddedLength(source.Length)); 785Debug.Assert(written == buf.Length); 821Debug.Assert(destination.Length == source.Length + 8); 839Debug.Assert(written == B.Length); 879Debug.Assert(written == B.Length);
System\Security\Cryptography\AesImplementation.Windows.cs (1)
51Debug.Assert(destination.Length == GetKeyWrapPaddedLength(source.Length));
System\Security\Cryptography\AsnFormatter.cs (1)
41Debug.Assert(j == hexOrder.Length);
System\Security\Cryptography\Base64Transforms.cs (10)
55Debug.Assert(written == output.Length); 163bytesToTransform = transformBuffer.Length; 172ReturnToCryptoPool(transformBufferArray, transformBuffer.Length); 179ReturnToCryptoPool(transformBufferArray, transformBuffer.Length); 210bytesToTransform = transformBuffer.Length; 218ReturnToCryptoPool(transformBufferArray, transformBuffer.Length); 229ReturnToCryptoPool(transformBufferArray, transformBuffer.Length); 276int len = tmpBuffer.Length; 295int bytesToTransform = transformBuffer.Length; 302transformBuffer.Slice(transformBuffer.Length - _inputIndex).CopyTo(_inputBuffer);
System\Security\Cryptography\BasicSymmetricCipherLiteBCrypt.cs (1)
56byte[] rented = CryptoPool.Rent(output.Length);
System\Security\Cryptography\BasicSymmetricCipherLiteNCrypt.cs (3)
66byte[] rented = CryptoPool.Rent(output.Length); 103Interop.NCrypt.NCryptEncrypt(keyHandle, input, input.Length, null, output, output.Length, out bytesWritten, AsymmetricPaddingMode.None) : 104Interop.NCrypt.NCryptDecrypt(keyHandle, input, input.Length, null, output, output.Length, out bytesWritten, AsymmetricPaddingMode.None);
System\Security\Cryptography\CapiHelper.Windows.cs (1)
935Debug.Assert(outputCount <= output.Length);
System\Security\Cryptography\CryptographicOperations.cs (4)
228if (destination.Length < hashSizeInBytes) 305CheckDestinationSize(hashSizeInBytes, destination.Length); 543if (destination.Length < hashSizeInBytes) 655CheckDestinationSize(hashSizeInBytes, destination.Length);
System\Security\Cryptography\DSA.cs (1)
883Debug.Assert(tmp.Length == HashBufferStackSize);
System\Security\Cryptography\ECDsa.cs (4)
147if (maxSignatureSize > signature.Length) 429if (maxSignatureSize > signature.Length) 1018if (hash.Length <= destination.Length) 1203Debug.Assert(tmp.Length == HashBufferStackSize);
System\Security\Cryptography\HashAlgorithm.cs (2)
57if (destination.Length < HashSizeValue / 8) 265if (destination.Length >= hashSizeInBytes)
System\Security\Cryptography\HashProvider.cs (1)
52if (destination.Length < HashSizeInBytes)
System\Security\Cryptography\HashProviderCng.cs (2)
80Debug.Assert(destination.Length >= _hashSize); 100Debug.Assert(destination.Length >= _hashSize);
System\Security\Cryptography\HashProviderDispenser.Windows.cs (5)
134if (destination.Length < hashSize) 170if (destination.Length < hashSize) 256digestSizeInBytes = destination.Length; 261digestSizeInBytes = destination.Length; 269if (destination.Length < digestSizeInBytes)
System\Security\Cryptography\HashStatic.cs (2)
53if (destination.Length < THash.HashSizeInBytes) 69if (destination.Length < THash.HashSizeInBytes)
System\Security\Cryptography\Helpers.cs (3)
339if (stackCount == stack.Length) 341Span<(int, int)> nextStack = new (int, int)[stack.Length * 2]; 377return ref buffer.Length != 0 ? ref MemoryMarshal.GetReference(buffer) : ref Unsafe.AsRef<byte>((void*)1);
System\Security\Cryptography\HKDF.cs (6)
55if (prk.Length < hashLength) 60if (prk.Length > hashLength) 122if (output.Length == 0) 130if (output.Length > maxOkmLength) 179if (output.Length == 0) 184if (output.Length > maxOkmLength)
System\Security\Cryptography\HKDF.Windows.cs (2)
212destination.Length, 221if (destination.Length != resultLength)
System\Security\Cryptography\HKDFManagedImplementation.cs (7)
15Debug.Assert(written == prk.Length, $"Bytes written is {written} bytes which does not match output length ({prk.Length} bytes)"); 58if (remainingOutput.Length >= hashLength) 66if (remainingOutput.Length > 0) 71lastChunk.Slice(0, remainingOutput.Length).CopyTo(remainingOutput); 97Debug.Assert(written == output.Length, $"Bytes written is {written} bytes which does not match output length ({output.Length} bytes)");
System\Security\Cryptography\HMACStatic.cs (2)
73if (destination.Length < THMAC.HashSizeInBytes) 89if (destination.Length < THMAC.HashSizeInBytes)
System\Security\Cryptography\IncrementalHash.cs (8)
146/// <paramref name="destination"/> has a <see cref="Span{T}.Length"/> value less 153if (destination.Length < HashLengthInBytes) 163if (destination.Length < HashLengthInBytes) 175Debug.Assert(destination.Length >= HashLengthInBytes); 218/// <paramref name="destination"/> has a <see cref="Span{T}.Length"/> value less 225if (destination.Length < HashLengthInBytes) 253if (destination.Length < HashLengthInBytes) 265Debug.Assert(destination.Length >= HashLengthInBytes);
System\Security\Cryptography\Kmac128.cs (2)
137Debug.Assert(written == destination.Length); 177Debug.Assert(written == destination.Length);
System\Security\Cryptography\Kmac256.cs (2)
137Debug.Assert(written == destination.Length); 177Debug.Assert(written == destination.Length);
System\Security\Cryptography\KmacXof128.cs (2)
137Debug.Assert(written == destination.Length); 177Debug.Assert(written == destination.Length);
System\Security\Cryptography\KmacXof256.cs (2)
137Debug.Assert(written == destination.Length); 177Debug.Assert(written == destination.Length);
System\Security\Cryptography\LiteHash.Windows.cs (11)
137CheckStatus(Interop.BCrypt.BCryptFinishHash(dup, pDestination, destination.Length, _finishFlags)); 141return destination.Length; 148CheckStatus(Interop.BCrypt.BCryptFinishHash(_hashHandle, pDestination, destination.Length, _finishFlags)); 151return destination.Length; 249NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(_hashHandle, pDestination, destination.Length, dwFlags: 0); 256return destination.Length; 270NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(tmpHash, pDestination, destination.Length, dwFlags: 0); 289NTSTATUS ntStatus = Interop.BCrypt.BCryptFinishHash(_hashHandle, pDestination, destination.Length, dwFlags: BCRYPT_HASH_DONT_RESET_FLAG); 360Debug.Assert(destination.Length >= _hashSizeInBytes, $"{destination.Length} >= {_hashSizeInBytes}"); 433Debug.Assert(destination.Length >= _hashSizeInBytes);
System\Security\Cryptography\LiteHashProvider.Xof.cs (2)
17Debug.Assert(written == destination.Length); 39Debug.Assert(written == destination.Length);
System\Security\Cryptography\Pbkdf2Implementation.Windows.cs (3)
175bufferDesc.cBuffers = buffers.Length; 182destination.Length, 191if (destination.Length != resultLength)
System\Security\Cryptography\PemEncoding.cs (4)
235Debug.Assert(destination.Length >= size); 465if (destination.Length < encodedSize) 528if (destination.Length < encodedSize) 719if (charsWritten != destination.Length)
System\Security\Cryptography\RandomNumberGenerator.cs (22)
59byte[] array = ArrayPool<byte>.Shared.Rent(data.Length); 62GetBytes(array, 0, data.Length); 63new ReadOnlySpan<byte>(array, 0, data.Length).CopyTo(data); 67Array.Clear(array, 0, data.Length); 82byte[] array = ArrayPool<byte>.Shared.Rent(data.Length); 89new ReadOnlySpan<byte>(array, 0, data.Length).CopyTo(data); 93Array.Clear(array, 0, data.Length); 291int n = values.Length; 318int needed = (destination.Length + 1) >>> 1; 323if (destination.Length % 2 != 0) 335needed = destination.Length / 2; 344destination = destination.Slice(remainingRandom.Length * 2); 373if (destination.Length < randomBytes.Length) 375randomBytes = randomBytes.Slice(0, destination.Length); 380for (int i = 0; i < randomBytes.Length; i++) 385destination = destination.Slice(randomBytes.Length); 401if (destination.Length * 2 < randomBytes.Length) 403randomBytes = randomBytes.Slice(0, destination.Length * 2); 411if ((uint)i >= (uint)destination.Length) 431for (int i = 0; i < destination.Length; i++)
System\Security\Cryptography\RandomNumberGeneratorImplementation.cs (6)
21if (data.Length > 0) 23fixed (byte* ptr = data) GetBytes(ptr, data.Length); 42if (data.Length > 0) 44fixed (byte* ptr = data) GetBytes(ptr, data.Length); 62while (data.Length > 0) 97data = data.Slice(data.Length - zerosFound);
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
186int cb = destination.Length;
System\Security\Cryptography\RSA.cs (4)
106if (destination.Length >= result.Length) 121if (destination.Length >= result.Length) 330if (destination.Length >= result.Length) 345if (destination.Length >= result.Length)
System\Security\Cryptography\RSABCrypt.cs (1)
224if (destination.Length < modulusSizeInBytes)
System\Security\Cryptography\SymmetricAlgorithm.cs (1)
776|| (uint)written > decryptBuffer.Length)
System\Security\Cryptography\SymmetricPadding.cs (5)
48if (destination.Length < count) 63if (destination.Length < ansiSize) 80if (destination.Length < isoSize) 97if (destination.Length < pkcsSize) 118if (destination.Length < zeroSize)
System\Security\Cryptography\UniversalCryptoDecryptor.cs (1)
114if (decryptedBytes.Length > 0)
System\Security\Cryptography\UniversalCryptoOneShot.cs (6)
38if (output.Length >= input.Length) 69if (!depaddingRequired || input.Length - cipher.BlockSizeInBytes > output.Length) 93if (output.Length < depaddedLength) 144if (output.Length - writtenToOutput < depaddedLength) 185if (unpaddedLength > output.Length) 212if (output.Length < ciphertextLength)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
1068Span<byte> pk2 = publicKeysBuffer.Slice(pk1.Length, publicKey.Algorithm.PublicKeySizeInBytes);
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (2)
568charsWritten != destination.Length) 616if (buffer.Length < certSize)
System.Security.Cryptography.Cose (5)
System\Security\Cryptography\Cose\CoseKey.cs (1)
207return mldsaSignature.Length;
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (2)
350if (expectedSize > destination.Length) 583if (destination.Length < GetEncodedLength())
System\Security\Cryptography\Cose\CoseSign1Message.cs (2)
281if (expectedSize > destination.Length) 999if (destination.Length < GetEncodedLength())
System.Security.Cryptography.Pkcs (57)
Internal\Cryptography\Pal\Windows\HelpersWindows.cs (4)
375int size = stackSpan.Length; 390size = stackSpan.Length; 438int len = buf.Length; 442if (len > buf.Length)
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.CryptGetProvParam.cs (1)
64if (dwDataLen > pbData.Length)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
47int length = FormatMessage(flags, moduleHandle, unchecked((uint)errorCode), 0, bufferPtr, stackBuffer.Length, IntPtr.Zero);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (2)
57Return(_skipClear ? 0 : Span.Length); 114if (currentBuffer.Length >= length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (10)
103Debug.Assert(destination.Length >= encryptedData.Length); 213if (byteCount > buf.Length) 229Debug.Assert(written == buf.Length); 498if (byteCount > buf.Length) 514Debug.Assert(written == buf.Length); 531CryptoPool.Return(rented, buf.Length); 967byte[] rentedDestination = CryptoPool.Rent(destination.Length); 1013CryptoPool.Return(rentedDestination, destination.Length); 1048if (!hasher.TryGetHashAndReset(t, out tLength) || tLength != t.Length) 1056t.Slice(0, dk.Length).CopyTo(dk);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (3)
212if (!mac.TryGetHashAndReset(macSpan, out int bytesWritten) || bytesWritten != macSpan.Length) 214Debug.Fail($"TryGetHashAndReset wrote {bytesWritten} of {macSpan.Length} bytes"); 356if (destination.Length < _sealedData.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (20)
183if (!hash.TryGetHashAndReset(hashBuf, out int bytesWritten) || bytesWritten != hashBuf.Length) 185Debug.Fail($"Hash output wrote {bytesWritten} bytes when {hashBuf.Length} was expected"); 200if (hashBuf.Length >= destination.Length) 202hashBuf.Slice(0, destination.Length).CopyTo(destination); 207destination = destination.Slice(hashBuf.Length); 216for (int j = (I.Length / vBytes) - 1; j >= 0; j--) 238Debug.Assert(into.Length == addend.Length); 242for (int i = into.Length - 1; i >= 0; i--) 254while (destination.Length > 0) 256if (destination.Length >= bytes.Length) 263bytes.Slice(0, destination.Length).CopyTo(destination); 273Debug.Assert(destination.Length % 2 == 0); 275while (destination.Length > 0) 277if (destination.Length >= fullCopyLen) 288Span<byte> nullTerminator = destination.Slice(0, Math.Min(2, destination.Length)); 290destination = destination.Slice(nullTerminator.Length); 294ReadOnlySpan<char> trimmed = password.Slice(0, destination.Length / 2); 298if (count != destination.Length) 300Debug.Fail($"Partial copy wrote {count} bytes of {destination.Length} expected");
System\Security\Cryptography\Pkcs\CmsHash.cs (2)
47if (destination.Length < OutputSizeBytes) 77if (destination.Length < OutputSizeBytes)
System\Security\Cryptography\Pkcs\CmsSignature.cs (3)
173int fieldSize = ieeeSignature.Length / 2; 176fieldSize * 2 == ieeeSignature.Length, 177$"ieeeSignature.Length ({ieeeSignature.Length}) must be even");
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (1)
153if (destination.Length < _encodedBytes.Length)
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (3)
191$"TryGetHashAndReset did not fit in {stackSpan.Length} for hash {hashAlgorithmId.Value}"); 489written != thumbprint.Length || 527$"TryGetCertHash did not fit in {thumbprint.Length} for hash {certId2.Value.HashAlgorithm.Algorithm}");
System\Security\Cryptography\Pkcs\Rfc3161TimestampTokenInfo.cs (1)
215if (destination.Length < _encodedBytes.Length)
System.Security.Cryptography.ProtectedData (2)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
47int length = FormatMessage(flags, moduleHandle, unchecked((uint)errorCode), 0, bufferPtr, stackBuffer.Length, IntPtr.Zero);
System\Security\Cryptography\ProtectedData.cs (1)
388if (outputBlob.cbData > outputSpan.Length)
System.Security.Cryptography.Xml (6)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
System.ServiceModel.NetFramingBase (2)
System\ServiceModel\Channels\Connection.cs (2)
242byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 243Memory<byte> memBuffer = new Memory<byte>(sharedBuffer, 0, buffer.Length);
System.ServiceProcess.ServiceController (15)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\ServiceProcess\ServiceBase.cs (1)
635for (int i = 0; i < entries.Length; i++)
System.Text.Encoding.CodePages (1)
System\Text\BaseCodePageEncoding.netcoreapp.cs (1)
18Debug.Assert(bytesRead == codePageIndex.Length);
System.Text.Encodings.Web (62)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (2)
70Debug.Assert(definedCharsBitmapAsLittleEndian.Length == thisAllowedCharactersBitmap.Length * sizeof(uint)); 87for (int i = 0; i < thisAllowedCharactersBitmap.Length; i++)
System\Text\Encodings\Web\DefaultHtmlEncoder.cs (8)
109if ((uint)destination.Length <= (uint)idxOfSemicolon) { goto OutOfSpaceInner; } 118for (int i = destination.Length - 1; (uint)destination.Length > (uint)i; i--) 125return destination.Length + 4; 184if ((uint)destination.Length <= (uint)idxOfSemicolon) { goto OutOfSpaceInner; } 195for (int i = destination.Length - 1; (uint)destination.Length > (uint)i; i--) 202return destination.Length + 4;
System\Text\Encodings\Web\DefaultJavaScriptEncoder.cs (6)
117if ((uint)destination.Length <= 1) { goto OutOfSpace; } 135if ((uint)destination.Length <= 5) { goto OutOfSpaceInner; } 146if ((uint)destination.Length <= 11) { goto OutOfSpaceInner; } 168if ((uint)destination.Length <= 1) { goto OutOfSpace; } 186if ((uint)destination.Length <= 5) { goto OutOfSpaceInner; } 197if ((uint)destination.Length <= 11) { goto OutOfSpaceInner; }
System\Text\Encodings\Web\DefaultUrlEncoder.cs (8)
146if ((uint)destination.Length <= 2) { goto OutOfSpace; } 151if ((uint)destination.Length <= 5) { goto OutOfSpace; } 156if ((uint)destination.Length <= 8) { goto OutOfSpace; } 161if ((uint)destination.Length <= 11) { goto OutOfSpace; } 175if ((uint)destination.Length <= 2) { goto OutOfSpace; } 180if ((uint)destination.Length <= 5) { goto OutOfSpace; } 185if ((uint)destination.Length <= 8) { goto OutOfSpace; } 190if ((uint)destination.Length <= 11) { goto OutOfSpace; }
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (3)
153if ((uint)destination.Length <= (uint)dstIdx) 173if ((uint)destination.Length <= (uint)dstIdxTemp) 290if ((uint)destination.Length <= (uint)dstIdxTemp)
System\Text\Encodings\Web\TextEncoder.cs (15)
46return TryEncodeUnicodeScalar((int)unicodeScalar, pBuffer, buffer.Length, out charsWritten); 76if ((uint)utf8Destination.Length > (uint)dstIdx) 168if (charsWrittenJustNow == 0 || (uint)charsWrittenJustNow > (uint)destBuffer.Length) 175stringBuilder.Length -= destBuffer.Length - charsWrittenJustNow; 293if (utf8Destination.Length < utf8Source.Length) 295sourceSearchSpace = utf8Source.Slice(0, utf8Destination.Length); 330int originalUtf8DestinationLength = utf8Destination.Length; 355if ((uint)dstIdxTemp >= (uint)utf8Destination.Length) 383bytesWritten = originalUtf8DestinationLength - utf8Destination.Length; 423if (destination.Length < source.Length) 425sourceSearchSpace = source.Slice(0, destination.Length); 455int originalDestinationLength = destination.Length; 499charsWritten = originalDestinationLength - destination.Length; 527if (charsWrittenJustNow == 0 || (uint)charsWrittenJustNow > (uint)scratchBuffer.Length) 580if (destination.Length < source.Length)
System.Text.Json (55)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
src\runtime\src\libraries\System.Text.Json\Common\JsonCamelCaseNamingPolicy.cs (2)
30for (int i = 0; i < chars.Length; i++) 37bool hasNext = (i + 1 < chars.Length);
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (4)
78Span<(TKey, int)> keys = span.Length <= StackallocThreshold 79? (stackalloc (TKey, int)[StackallocThreshold]).Slice(0, span.Length) 80: new (TKey, int)[span.Length]; 82for (int i = 0; i < keys.Length; i++)
src\runtime\src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (2)
177if (charsWritten == destination.Length) 187int newSize = checked(destination.Length * 2);
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (1)
187Span<byte> utf8Unescaped = remaining <= utf8UnescapedStack.Length ?
System\Text\Json\JsonEncodedText.cs (1)
91Debug.Assert(expectedByteCount == utf8Bytes.Length);
System\Text\Json\Reader\JsonReaderHelper.cs (3)
190if (JsonHelpers.IsValidUnescapedDateTimeOffsetParseLength(sourceUnescaped.Length) 238if (JsonHelpers.IsValidUnescapedDateTimeOffsetParseLength(sourceUnescaped.Length) 287if (utf8Unescaped.Length == JsonConstants.MaximumFormatGuidLength
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (4)
358Debug.Assert(destination.Length >= source.Length); 371Debug.Assert(destination.Length >= source.Length); 408if (written == destination.Length) 513if ((uint)(written + nextUnescapedSegmentLength) >= (uint)destination.Length)
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (1)
588int amountToWrite = Math.Min(span.Length, readSoFar.Length - written);
System\Text\Json\Serialization\Converters\Value\Ieee754FloatingPointConverter.cs (1)
272rented = ArrayPool<byte>.Shared.Rent(destination.Length * 2);
System\Text\Json\Serialization\ValueBitArray.cs (4)
61Debug.Assert(stackBuffer.Length == ScratchBufferSize); 66_buffer = requiredUInt64Count <= stackBuffer.Length 79if (_buffer.Length is 1) 85for (int i = 0; i < _buffer.Length; i++)
System\Text\Json\Writer\JsonWriterHelper.cs (2)
15Debug.Assert(buffer.Length >= indent); 321quotedValue[quotedValue.Length - 1] = JsonConstants.Quote;
System\Text\Json\Writer\JsonWriterHelper.Date.cs (6)
51Debug.Assert(buffer.Length == maxDateTimeLength || 52buffer.Length == maxDateTimeLength + 1 || 53buffer.Length == JsonConstants.MaximumFormatDateTimeOffsetLength); 77bytesWritten = buffer.Length; 83if (buffer.Length == maxDateTimeLength) 88else if (buffer.Length == JsonConstants.MaximumFormatDateTimeOffsetLength)
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (4)
408if (combinedBuffer.Length is 3) 416Debug.Assert(combinedBuffer.Length is 1 or 2); 543if ((uint)total >= (uint)dest.Length) 554if ((uint)total >= (uint)dest.Length)
System.Text.Json.SourceGeneration (20)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (12)
32Debug.Assert(value <= _span.Length); 53if ((uint)pos < (uint)span.Length) 69if (source.Length == 1 && (uint)pos < (uint)span.Length) 83if ((uint)(_pos + source.Length) > (uint)_span.Length) 96if ((uint)(_pos + source.Length) > (uint)_span.Length) 113if ((uint)(pos + length) <= (uint)span.Length) 137Debug.Assert(_pos == _span.Length); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 215int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _pos + additionalCapacityBeyondPos); 225nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
src\runtime\src\libraries\System.Text.Json\Common\JsonCamelCaseNamingPolicy.cs (2)
30for (int i = 0; i < chars.Length; i++) 37bool hasNext = (i + 1 < chars.Length);
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (4)
78Span<(TKey, int)> keys = span.Length <= StackallocThreshold 79? (stackalloc (TKey, int)[StackallocThreshold]).Slice(0, span.Length) 80: new (TKey, int)[span.Length]; 82for (int i = 0; i < keys.Length; i++)
src\runtime\src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (2)
177if (charsWritten == destination.Length) 187int newSize = checked(destination.Length * 2);
System.Text.RegularExpressions (49)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (12)
32Debug.Assert(value <= _span.Length); 53if ((uint)pos < (uint)span.Length) 69if (source.Length == 1 && (uint)pos < (uint)span.Length) 83if ((uint)(_pos + source.Length) > (uint)_span.Length) 96if ((uint)(_pos + source.Length) > (uint)_span.Length) 113if ((uint)(pos + length) <= (uint)span.Length) 137Debug.Assert(_pos == _span.Length); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 215int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _pos + additionalCapacityBeyondPos); 225nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Text\RegularExpressions\Regex.Replace.cs (2)
679for (int i = 0; i < span.Length; i++) 686for (int i = 0; i < span.Length; i++)
System\Text\RegularExpressions\RegexCharClass.cs (9)
545numCategories == categories.Length) 560numCategories == categories.Length) 585if (numCategories == categories.Length) 606if (numCategories == categories.Length) 729if (++evaluated > chars.Length) 1029Debug.Assert(twoChars.Length >= 2); 1589span[SetLengthIndex] = (char)(span.Length - SetStartIndex); 1600Debug.Assert(i == span.Length); 1982Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
System\Text\RegularExpressions\RegexCompiler.cs (1)
5542switch (setChars.Length)
System\Text\RegularExpressions\RegexReplacement.cs (2)
265int length = ((span.Length / 2) - 1) * replacement.Length; 266for (int i = 1; i < span.Length; i += 2) // the count of each pair is the second item
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (3)
428Debug.Assert(cat >= 0 && cat < categoryCodes.Length, $"Expected {cat} to be in range [0, {categoryCodes.Length})."); 507for (int i = 0; i < catCodes.Length; i++)
System.Text.RegularExpressions.Generator (45)
RegexGenerator.Emitter.cs (1)
5114indexOfExpr = setChars.Length switch
src\runtime\src\libraries\Common\src\Polyfills\EncodingPolyfills.cs (3)
39return encoding.GetBytes(charsPtr, chars.Length, bytesPtr, bytes.Length); 48return encoding.GetChars(bytesPtr, bytes.Length, charsPtr, chars.Length); 64if (charCount > chars.Length)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (12)
32Debug.Assert(value <= _span.Length); 53if ((uint)pos < (uint)span.Length) 69if (source.Length == 1 && (uint)pos < (uint)span.Length) 83if ((uint)(_pos + source.Length) > (uint)_span.Length) 96if ((uint)(_pos + source.Length) > (uint)_span.Length) 113if ((uint)(pos + length) <= (uint)span.Length) 137Debug.Assert(_pos == _span.Length); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 215int nextCapacity = Math.Max(_span.Length != 0 ? _span.Length * 2 : 4, _pos + additionalCapacityBeyondPos); 225nextCapacity = Math.Max(Math.Max(_span.Length + 1, ArrayMaxLength), _span.Length);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (9)
545numCategories == categories.Length) 560numCategories == categories.Length) 585if (numCategories == categories.Length) 606if (numCategories == categories.Length) 729if (++evaluated > chars.Length) 1029Debug.Assert(twoChars.Length >= 2); 1609span[SetLengthIndex] = (char)(span.Length - SetStartIndex); 1621Debug.Assert(i == span.Length); 1982Span<char> invertedGroup = group.Length <= scratch.Length ? scratch.Slice(0, group.Length) : new char[group.Length];
System.Threading.AccessControl (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
47int length = FormatMessage(flags, moduleHandle, unchecked((uint)errorCode), 0, bufferPtr, stackBuffer.Length, IntPtr.Zero);
System.Web.HttpUtility (22)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 466while (j < destination.Length) 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 501while (j < destination.Length)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (14)
40Debug.Assert(value <= _chars.Length); 45public int Capacity => _chars.Length; 53if ((uint)capacity > (uint)_chars.Length) 107if (_pos > _chars.Length - count) 127if (_pos > (_chars.Length - count)) 147if ((uint)pos < (uint)chars.Length) 167if (s.Length == 1 && (uint)pos < (uint)_chars.Length) // very common case, e.g. appending strings from NumberFormatInfo like separators, percent symbols, etc. 181if (pos > _chars.Length - s.Length) 196if (_pos > _chars.Length - count) 202for (int i = 0; i < dst.Length; i++) 212if (pos > _chars.Length - value.Length) 225if (origPos > _chars.Length - length) 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); 261Math.Min((uint)_chars.Length * 2, ArrayMaxLength));
System\Web\Util\HttpEncoder.cs (2)
682for (int i = idxOfFirstInvalidSurrogate; (uint)i < (uint)chars.Length; i++) 686if ((uint)(i + 1) >= (uint)chars.Length || !char.IsLowSurrogate(chars[i + 1]))
System.Windows.Forms (16)
System\Windows\Forms\ActiveX\AxHost.VBFormat.cs (2)
53if (format.Length >= buffer.Length) 56format = format[..(buffer.Length - 1)];
System\Windows\Forms\ActiveX\DataStreamFromComStream.cs (1)
78_comStream->Read(ch, (uint)buffer.Length, &bytesRead);
System\Windows\Forms\Control.cs (1)
2450length = PInvoke.GetClassName(lastParentHandle, lpClassName, buffer.Length);
System\Windows\Forms\Controls\ComboBox\ComboBox.AutoCompleteDropDownFinder.cs (1)
42int length = PInvoke.GetClassName(hwnd, (PWSTR)b, buffer.Length);
System\Windows\Forms\Controls\Labels\LinkUtilities.cs (1)
44int nMax = Math.Min(rgb.Length, rgbsCount);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
1102for (int i = 0; i < boldDates.Length; ++i, ++startMonth)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (1)
299cchName = (UIntPtr)name.Length - 1
System\Windows\Forms\Dialogs\CommonDialogs\ColorDialog.cs (1)
87MemoryMarshal.Cast<int, COLORREF>(value)[..Math.Min(customColors.Length, value.Length)].CopyTo(customColors);
System\Windows\Forms\Printing\PageSetupDialog.cs (1)
294buffer.Length);
System\Windows\Forms\SendKeys\SendKeys.cs (1)
311if (keystate.Length < 256)
System\Windows\Forms\VisualStyles\VisualStyleInformation.cs (3)
45PInvoke.GetCurrentThemeName(pFilename, filename.Length, null, 0, null, 0); 67PInvoke.GetCurrentThemeName(null, 0, pColorScheme, colorScheme.Length, null, 0); 89PInvoke.GetCurrentThemeName(null, 0, null, 0, pSize, size.Length);
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (2)
520_lastHResult = PInvoke.GetThemeFilename(HTHEME, Part, State, (THEME_PROPERTY_SYMBOL_ID)prop, pFilename, filename.Length); 649_lastHResult = PInvoke.GetThemeString(HTHEME, Part, State, (int)prop, pString, aString.Length);
System.Windows.Forms.Design (3)
System\ComponentModel\Design\ByteViewer.cs (2)
185Debug.Assert(charsBuffer.Length >= lineBuffer.Length); 207Debug.Assert(charsBuffer.Length >= lineBuffer.Length * 3 + 1);
System\Windows\Forms\Design\DesignerUtils.cs (1)
664for (int i = 0; i < alphaValues.Length; i++)
System.Windows.Forms.Primitives (137)
_generated\107\Windows.Win32.IAccessible.g.cs (2)
93 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 94 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\121\Windows.Win32.IEnumConnections.g.cs (1)
64 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgcd.Length, rgcdLocal, pcFetchedLocal);
_generated\124\Windows.Win32.IEnumOLEVERB.g.cs (2)
64 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 75 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\126\Windows.Win32.IEnumVARIANT.g.cs (1)
63 winmdroot.Foundation.HRESULT __result = this.Next((uint )rgVar.Length, rgVarLocal, pCeltFetchedLocal);
_generated\137\Windows.Win32.IFontDisp.g.cs (2)
86 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 87 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\142\Windows.Win32.IHTMLCurrentStyle.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\143\Windows.Win32.IHTMLDataTransfer.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\144\Windows.Win32.IHTMLDocument.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\145\Windows.Win32.IHTMLDocument2.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\146\Windows.Win32.IHTMLDocument3.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\147\Windows.Win32.IHTMLDocument4.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\148\Windows.Win32.IHTMLDOMNode.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\149\Windows.Win32.IHTMLElement.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\150\Windows.Win32.IHTMLElement2.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\151\Windows.Win32.IHTMLElement3.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\152\Windows.Win32.IHTMLElementCollection.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\153\Windows.Win32.IHTMLEventObj.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\154\Windows.Win32.IHTMLFiltersCollection.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\155\Windows.Win32.IHTMLFormElement.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\156\Windows.Win32.IHTMLFrameBase.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\157\Windows.Win32.IHTMLFramesCollection2.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\158\Windows.Win32.IHTMLImageElementFactory.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\159\Windows.Win32.IHTMLImgElement.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\160\Windows.Win32.IHTMLLocation.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\161\Windows.Win32.IHTMLMimeTypesCollection.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\162\Windows.Win32.IHTMLOpsProfile.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\163\Windows.Win32.IHTMLOptionElement.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\164\Windows.Win32.IHTMLOptionElementFactory.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\165\Windows.Win32.IHTMLPluginsCollection.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\166\Windows.Win32.IHTMLRect.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\167\Windows.Win32.IHTMLRectCollection.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\168\Windows.Win32.IHTMLRenderStyle.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\169\Windows.Win32.IHTMLRuleStyle.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\170\Windows.Win32.IHTMLScreen.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\171\Windows.Win32.IHTMLSelectionObject.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\172\Windows.Win32.IHTMLStyle.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\173\Windows.Win32.IHTMLStyleSheet.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\174\Windows.Win32.IHTMLStyleSheetRule.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\175\Windows.Win32.IHTMLStyleSheetRulesCollection.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\176\Windows.Win32.IHTMLStyleSheetsCollection.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\177\Windows.Win32.IHTMLWindow2.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\178\Windows.Win32.IHTMLWindow3.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\179\Windows.Win32.IHTMLWindow4.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\182\Windows.Win32.ILockBytes.g.cs (2)
64 this.ReadAt(ulOffset, (void* )pvLocal, (uint )pv.Length, pcbReadLocal); 74 this.ReadAt(ulOffset, (void* )pvLocal, (uint )pv.Length, default(uint* ));
_generated\216\Windows.Win32.IOmHistory.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\217\Windows.Win32.IOmNavigator.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\252\Windows.Win32.ITextDocument.g.cs (2)
86 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 87 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\253\Windows.Win32.ITextFont.g.cs (2)
86 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 87 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\254\Windows.Win32.ITextPara.g.cs (2)
86 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 87 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\257\Windows.Win32.ITextRange.g.cs (2)
86 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 87 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\259\Windows.Win32.ITextSelection.g.cs (2)
86 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 87 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\260\Windows.Win32.ITextStoryRanges.g.cs (2)
86 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 87 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\280\Windows.Win32.IWebBrowser.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\281\Windows.Win32.IWebBrowser2.g.cs (2)
97 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 98 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\282\Windows.Win32.IWebBrowserApp.g.cs (2)
85 if (!rgszNames.IsEmpty && !rgDispId.IsEmpty && rgszNames.Length != rgDispId.Length) throw new ArgumentException(); 86 this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )(rgDispId.IsEmpty ? rgszNames.Length : rgDispId.Length), lcid, rgDispIdLocal);
_generated\409\Windows.Win32.PInvoke.ADVAPI32.dll.g.cs (2)
54 winmdroot.Foundation.WIN32_ERROR __result = PInvoke.RegLoadMUIString(hKey, pszValueLocal, pszOutBufLocal, (uint )pszOutBuf.Length, pcbDataLocal, Flags, pszDirectoryLocal); 72 winmdroot.Foundation.WIN32_ERROR __result = PInvoke.RegLoadMUIString(hKey, pszValueLocal, pszOutBufLocal, (uint )pszOutBuf.Length, default(uint* ), Flags, pszDirectoryLocal);
_generated\413\Windows.Win32.PInvoke.dwmapi.dll.g.cs (1)
32 winmdroot.Foundation.HRESULT __result = PInvoke.DwmGetWindowAttribute(hwnd, dwAttribute, (void* )pvAttributeLocal, (uint )pvAttribute.Length);
_generated\415\Windows.Win32.PInvoke.GDI32.dll.g.cs (2)
150 int __result = PInvoke.GetBitmapBits(hbit, lpvBits.Length, (void* )lpvBitsLocal); 382 uint __result = PInvoke.GetSystemPaletteEntries(hdc, iStart, (uint )pPalEntries.Length, pPalEntriesLocal);
_generated\418\Windows.Win32.PInvoke.KERNEL32.dll.g.cs (3)
389 int __result = PInvoke.GetLocaleInfoEx(lpLocaleNameLocal, LCType, lpLCDataLocal, lpLCData.Length); 435 uint __result = PInvoke.GetModuleFileName(hModule, lpFilenameLocal, (uint )lpFilename.Length); 553 uint __result = PInvoke.GetShortPathName(lpszLongPathLocal, lpszShortPathLocal, (uint )lpszShortPath.Length);
_generated\423\Windows.Win32.PInvoke.SHELL32.dll.g.cs (1)
307 winmdroot.Foundation.BOOL __result = PInvoke.SHGetPathFromIDListEx(pidlLocal, pszPathLocal, (uint )pszPath.Length, uOpts);
_generated\426\Windows.Win32.PInvoke.USER32.dll.g.cs (5)
1291 int __result = PInvoke.GetClassName(hWnd, lpClassNameLocal, lpClassName.Length); 1596 int __result = PInvoke.GetKeyboardLayoutList(lpList.Length, lpListLocal); 1636 if (lpKeyState.Length < 256) throw new ArgumentException(); 2141 winmdroot.Foundation.BOOL __result = PInvoke.GetUserObjectInformation(hObj, nIndex, (void* )pvInfoLocal, (uint )pvInfo.Length, lpnLengthNeededLocal); 2153 winmdroot.Foundation.BOOL __result = PInvoke.GetUserObjectInformation(hObj, nIndex, (void* )pvInfoLocal, (uint )pvInfo.Length, default(uint* ));
_generated\427\Windows.Win32.PInvoke.UXTHEME.dll.g.cs (6)
255 winmdroot.Foundation.HRESULT __result = PInvoke.GetCurrentThemeName(pszThemeFileNameLocal, pszThemeFileName.Length, pszColorBuffLocal, pszColorBuff.Length, pszSizeBuffLocal, pszSizeBuff.Length); 559 winmdroot.Foundation.HRESULT __result = PInvoke.GetThemeDocumentationProperty(pszThemeNameLocal, pszPropertyNameLocal, pszValueBuffLocal, pszValueBuff.Length); 643 winmdroot.Foundation.HRESULT __result = PInvoke.GetThemeFilename(hTheme, iPartId, iStateId, iPropId, pszThemeFileNameLocal, pszThemeFileName.Length); 945 winmdroot.Foundation.HRESULT __result = PInvoke.GetThemeString(hTheme, iPartId, iStateId, iPropId, pszBuffLocal, pszBuff.Length);
_generated\484\Windows.Win32.System_Com_IEnumConnections_Extensions.g.cs (1)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgcd.Length, rgcdLocal, pcFetchedLocal);
_generated\489\Windows.Win32.System_Com_StructuredStorage_ILockBytes_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.ReadAt(ulOffset, (void* )pvLocal, (uint )pv.Length, pcbReadLocal); 42 winmdroot.Foundation.HRESULT __result = @this.ReadAt(ulOffset, (void* )pvLocal, (uint )pv.Length, default(uint* ));
_generated\495\Windows.Win32.System_Ole_IEnumOLEVERB_Extensions.g.cs (2)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, pceltFetchedLocal); 42 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgelt.Length, rgeltLocal, default(uint* ));
_generated\496\Windows.Win32.System_Ole_IEnumVARIANT_Extensions.g.cs (1)
31 winmdroot.Foundation.HRESULT __result = @this.Next((uint )rgVar.Length, rgVarLocal, pCeltFetchedLocal);
System\ComponentModel\TypeConverterHelper.cs (2)
35if (tokensCount != output.Length) 52for (int i = 0; i < output.Length; i++)
Windows\Win32\PInvoke.GetThemeDocumentationProperty.cs (1)
15GetThemeDocumentationProperty(pszTheme, pszProperty, pBuffer, buffer.Length);