189 references to ArraySegment
AutobahnTestApp (1)
Startup.cs (1)
45await webSocket.SendAsync(new ArraySegment<byte>(buffer, 0, result.Count), result.MessageType, result.EndOfMessage, cancellationToken);
ClientSample (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
dotnet-dev-certs (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
dotnet-getdocument (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
dotnet-openapi (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
dotnet-sql-cache (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
dotnet-svcutil-lib (24)
FrameworkFork\System.Runtime.Serialization\System\Xml\EncodingStreamWrapper.cs (2)
497seg = new ArraySegment<byte>(buffer, offset, count); 502seg = new ArraySegment<byte>(buffer, offset, count);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BinaryMessageEncoder.cs (3)
434return new ArraySegment<byte>(buffer, newOffset, newSize); 513return new ArraySegment<byte>(buffer, newOffset, newSize); 1440messageData.Open(new ArraySegment<byte>(buffer, offset, size), bufferManager);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferedMessageWriter.cs (1)
58return new ArraySegment<byte>(buffer, initialOffset, size - initialOffset);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingChannels.cs (1)
216return new ArraySegment<byte>(startBytes, 0, startSize);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingEncoders.cs (2)
231return new ArraySegment<byte>(buffer, messageFrame.Offset - spaceNeeded, messageFrame.Count + spaceNeeded); 315return new ArraySegment<byte>(buffer, offset, messageFrame.Count + spaceNeeded);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageHelper.cs (2)
205var messageBuffer = new ArraySegment<byte>(_factory.BufferManager.TakeBuffer(bufferSize), 0, bufferSize); 228return await DecodeBufferedMessageAsync(new ArraySegment<byte>(buffer, 0, offset), inputStream);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncoder.cs (1)
89return new ArraySegment<byte>(buffer, 0, offset);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncoderCompressionHandler.cs (2)
55buffer = new ArraySegment<byte>(decompressedBytes, buffer.Offset, length - buffer.Offset); 75buffer = new ArraySegment<byte>(compressedBytes, buffer.Offset, length - buffer.Offset);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SessionConnectionReader.cs (1)
391message = _messageEncoder.ReadMessage(new ArraySegment<byte>(EnvelopeBuffer, 0, EnvelopeSize), _bufferManager);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (9)
581new ArraySegment<byte>(internalBuffer, receivedByteCount, internalBuffer.Length - receivedByteCount), 767result = await _webSocket.ReceiveAsync(new ArraySegment<byte>(buffer, 0, _receiveBufferSize), cancelToken); 838new ArraySegment<byte>(buffer, 0, count), 849ArraySegment<byte> bytes = new ArraySegment<byte>(buffer, 0, count); 1060result = await _webSocket.ReceiveAsync(new ArraySegment<byte>(buffer, offset, count), cancellationToken); 1140await _webSocket.SendAsync(new ArraySegment<byte>(buffer, offset, count), _outgoingMessageType, false, cancellationToken); 1183Task task = _webSocket.SendAsync(new ArraySegment<byte>(Array.Empty<byte>(), 0, 0), _outgoingMessageType, true, timeoutHelper.GetCancellationToken()); 1209await _webSocket.SendAsync(new ArraySegment<byte>(Array.Empty<byte>(), 0, 0), _outgoingMessageType, true, cancelToken); 1251_initialReadBuffer = new ArraySegment<byte>(_initialReadBuffer.Array, _initialReadBuffer.Offset + bytesToCopy, _initialReadBuffer.Count - bytesToCopy);
dotnet-user-jwts (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
dotnet-user-secrets (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Extensibility.MessageEncoder.IntegrationTests (1)
CustomTextMessageEncoder.cs (1)
97ArraySegment<byte> byteArray = new ArraySegment<byte>(totalBytes, messageOffset, messageLength);
GetDocument.Insider (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (1)
202result = await webSocket.ReceiveAsync(new ArraySegment<byte>(received, offset, received.Length - offset), default);
IISExpress.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (1)
202result = await webSocket.ReceiveAsync(new ArraySegment<byte>(received, offset, received.Length - offset), default);
InMemory.FunctionalTests (2)
Http2\Http2ConnectionTests.cs (1)
965await SendDataAsync(1, new ArraySegment<byte>(_helloWorldBytes, i, 1), endStream: false);
Http2\Http2TestBase.cs (1)
243data.AddRange(new ArraySegment<byte>(buffer, 0, received));
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.WebSockets.cs (1)
181await webSocket.SendAsync(new ArraySegment<byte>(buffer, 0, result.Count), result.MessageType, result.EndOfMessage, token);
Microsoft.AspNetCore.Components (2)
RenderTree\ArrayBuilderSegment.cs (2)
55=> ((IEnumerable<T>)new ArraySegment<T>(Array, _offset, _count)).GetEnumerator(); 58=> ((IEnumerable)new ArraySegment<T>(Array, _offset, _count)).GetEnumerator();
Microsoft.AspNetCore.Components.Authorization.Tests (1)
src\Components\Shared\test\ArrayRangeExtensions.cs (1)
15return new ArraySegment<T>(source.Array, 0, source.Count);
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\Buffering\BufferedTextWriter.cs (1)
29=> _currentOutput.Add(new TextChunk(new ArraySegment<char>(buffer, index, count), _charArraySegmentBuilder));
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Buffering\TextChunkTest.cs (1)
34var chunk = new TextChunk(new ArraySegment<char>(chars, 1, 3), charArrayScope);
Microsoft.AspNetCore.Components.Forms.Tests (1)
src\Components\Shared\test\ArrayRangeExtensions.cs (1)
15return new ArraySegment<T>(source.Array, 0, source.Count);
Microsoft.AspNetCore.Components.Server (2)
Circuits\RemoteRenderer.cs (1)
222var segment = new ArraySegment<byte>(pending.Data.Buffer, 0, pending.Data.Count);
ComponentHub.cs (1)
502yield return new ArraySegment<byte>(buffer, 0, bytesRead);
Microsoft.AspNetCore.Components.Tests (1)
src\Components\Shared\test\ArrayRangeExtensions.cs (1)
15return new ArraySegment<T>(source.Array, 0, source.Count);
Microsoft.AspNetCore.Components.Web.Tests (1)
src\Components\Shared\test\ArrayRangeExtensions.cs (1)
15return new ArraySegment<T>(source.Array, 0, source.Count);
Microsoft.AspNetCore.Components.WebView (1)
IpcCommon.cs (1)
46args = new ArraySegment<JsonElement>(parsed, 1, parsed.Length - 1);
Microsoft.AspNetCore.DataProtection (6)
ArraySegmentExtensions.cs (1)
27_ = new ArraySegment<T>(arraySegment.Array!, arraySegment.Offset, arraySegment.Count);
KeyManagement\KeyRingBasedDataProtector.cs (1)
281ArraySegment<byte> ciphertext = new ArraySegment<byte>(protectedData, sizeof(uint) + sizeof(Guid), protectedData.Length - (sizeof(uint) + sizeof(Guid))); // chop off magic header + encryptor id
Managed\AesGcmAuthenticatedEncryptor.cs (1)
99var keyModifier = new ArraySegment<byte>(ciphertext.Array!, keyModifierOffset, KEY_MODIFIER_SIZE_IN_BYTES);
Managed\ManagedAuthenticatedEncryptor.cs (2)
117rgbKey: new ArraySegment<byte>(tempKeys, 0, _symmetricAlgorithmSubkeyLengthInBytes).AsStandaloneArray(), 129using (var hashAlg = CreateValidationAlgorithm(new ArraySegment<byte>(tempKeys, _symmetricAlgorithmSubkeyLengthInBytes, _validationAlgorithmSubkeyLengthInBytes).AsStandaloneArray()))
XmlEncryption\XmlEncryptionExtensions.cs (1)
172return new Secret(new ArraySegment<byte>(underlyingBuffer, 0, checked((int)memoryStream.Length)));
Microsoft.AspNetCore.DataProtection.Tests (17)
Cng\CbcAuthenticatedEncryptorTests.cs (2)
93ArraySegment<byte> plaintext = new ArraySegment<byte>(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 }, 2, 3); 94ArraySegment<byte> aad = new ArraySegment<byte>(new byte[] { 7, 6, 5, 4, 3, 2, 1, 0 }, 1, 4);
Cng\CngAuthenticatedEncryptorBaseTests.cs (4)
14var ciphertext = new ArraySegment<byte>(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04 }, 3, 2); 15var aad = new ArraySegment<byte>(new byte[] { 0x10, 0x11, 0x12, 0x13, 0x14 }, 1, 4); 39var ciphertext = new ArraySegment<byte>(new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04 }, 3, 2); 65var aad = new ArraySegment<byte>(new byte[] { 0x10, 0x11, 0x12, 0x13, 0x14 }, 1, 4);
Cng\GcmAuthenticatedEncryptorTests.cs (2)
83ArraySegment<byte> plaintext = new ArraySegment<byte>(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 }, 2, 3); 84ArraySegment<byte> aad = new ArraySegment<byte>(new byte[] { 7, 6, 5, 4, 3, 2, 1, 0 }, 1, 4);
Managed\ManagedAuthenticatedEncryptorTests.cs (2)
87ArraySegment<byte> plaintext = new ArraySegment<byte>(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 }, 2, 3); 88ArraySegment<byte> aad = new ArraySegment<byte>(new byte[] { 7, 6, 5, 4, 3, 2, 1, 0 }, 1, 4);
SecretTests.cs (4)
24var input = new ArraySegment<byte>(new byte[] { 0x10, 0x20, 0x30, 0x40, 0x50, 0x60 }, 1, 3); 34var outputSegment = new ArraySegment<byte>(new byte[7], 2, 3); 61var outputSegment = new ArraySegment<byte>(new byte[7], 2, 3); 143var outputSegment = new ArraySegment<byte>(new byte[7], 2, 3);
SP800_108\SP800_108Tests.cs (3)
160var labelSegment = new ArraySegment<byte>(new byte[label.Length + 10], 3, label.Length); 162var contextSegment = new ArraySegment<byte>(new byte[context.Length + 10], 5, context.Length); 164var derivedSubkeySegment = new ArraySegment<byte>(new byte[numDerivedBytes + 10], 4, numDerivedBytes);
Microsoft.AspNetCore.Server.HttpSys (3)
Helpers.cs (1)
84return new ArraySegment<byte>(header, offset, header.Length - offset);
RequestProcessing\ResponseBody.cs (2)
539var data = new ArraySegment<byte>(buffer, offset, count); 591var data = new ArraySegment<byte>(buffer, offset, count);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (10)
Http2\Http2HPackEncoderTests.cs (1)
489Assert.Equal(expectedPayload, new ArraySegment<byte>(payload, 0, length).ToArray());
MessageBodyTests.cs (9)
46AssertASCII("Hello", new ArraySegment<byte>(buffer, 0, count)); 172AssertASCII("Hello", new ArraySegment<byte>(buffer, 0, count)); 199AssertASCII("Hello", new ArraySegment<byte>(buffer, 0, count)); 320AssertASCII("Hello", new ArraySegment<byte>(buffer, 0, count)); 432AssertASCII("Hello", new ArraySegment<byte>(buffer, 0, count)); 459AssertASCII("Hello", new ArraySegment<byte>(buffer, 0, count)); 536AssertASCII(largeInput + "Hello", new ArraySegment<byte>(requestArray, 0, requestArray.Length)); 667AssertASCII("Hello", new ArraySegment<byte>(buffer, 0, 5)); 694AssertASCII("Hello", new ArraySegment<byte>(buffer, 0, 5));
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Microsoft.AspNetCore.SpaServices.Extensions (2)
Proxying\SpaProxy.cs (1)
310await destination.SendAsync(new ArraySegment<byte>(buffer, 0, result.Count), result.MessageType, result.EndOfMessage, cancellationToken);
Util\EventedStreamReader.cs (1)
92OnChunk(new ArraySegment<char>(buf, 0, chunkLength));
Microsoft.AspNetCore.TestHost (1)
TestWebSocket.cs (1)
146receiveMessage.Buffer = new ArraySegment<byte>(receiveMessage.Buffer.Array!, receiveMessage.Buffer.Offset + count, receiveMessage.Buffer.Count - count);
Microsoft.AspNetCore.TestHost.Tests (3)
TestClientTests.cs (3)
595var sendBuffer = new System.ArraySegment<byte>(receiveArray, 0, receiveResult.Count); 717var sendBuffer = new System.ArraySegment<byte>(receiveArray, 0, receiveResult.Count); 794var sendBuffer = new System.ArraySegment<byte>(receiveArray, 0, receiveResult.Count);
Microsoft.AspNetCore.WebSockets.Tests (13)
BufferStream.cs (2)
135_topBuffer = new ArraySegment<byte>(_topBuffer.Array, 199_topBuffer = new ArraySegment<byte>(_topBuffer.Array,
WebSocketMiddlewareTests.cs (11)
186new ArraySegment<byte>(serverBuffer, totalReceived, serverBuffer.Length - totalReceived), CancellationToken.None); 194new ArraySegment<byte>(serverBuffer, totalReceived, serverBuffer.Length - totalReceived), CancellationToken.None); 206await client.SendAsync(new ArraySegment<byte>(originalData, 0, 2), WebSocketMessageType.Binary, false, CancellationToken.None); 209await client.SendAsync(new ArraySegment<byte>(originalData, 2, 2), WebSocketMessageType.Binary, false, CancellationToken.None); 212await client.SendAsync(new ArraySegment<byte>(originalData, 4, 7), WebSocketMessageType.Binary, true, CancellationToken.None); 287result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer, receivedCount, clientBuffer.Length - receivedCount), CancellationToken.None); 309await webSocket.SendAsync(new ArraySegment<byte>(originalData, 0, 2), WebSocketMessageType.Binary, false, CancellationToken.None); 310await webSocket.SendAsync(new ArraySegment<byte>(originalData, 2, 2), WebSocketMessageType.Binary, false, CancellationToken.None); 311await webSocket.SendAsync(new ArraySegment<byte>(originalData, 4, 7), WebSocketMessageType.Binary, true, CancellationToken.None); 325new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None); 332new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None);
Microsoft.AspNetCore.WebUtilities (1)
BufferedReadStream.cs (1)
55get { return new ArraySegment<byte>(_buffer, _bufferOffset, _bufferCount); }
Microsoft.CodeAnalysis (3)
DiaSymReader\Utilities\ComMemoryStream.cs (1)
98yield return new ArraySegment<byte>(chunk, 0, bytesToCopy);
ReferenceManager\CommonReferenceManager.Binding.cs (1)
412new ArraySegment<AssemblyReferenceBinding>(bindingsOfAssemblyBeingBuilt, bindingIndex, moduleBindingsCount)));
Text\SourceText.cs (1)
278var embeddedTextBlob = canBeEmbedded ? EmbeddedText.CreateBlob(new ArraySegment<byte>(buffer, 0, length)) : default(ImmutableArray<byte>);
Microsoft.CodeAnalysis.UnitTests (6)
EmbeddedTextTests.cs (6)
28Assert.Throws<ArgumentException>("checksumAlgorithm", () => EmbeddedText.FromBytes("path", new ArraySegment<byte>(new byte[0], 0, 0), SourceHashAlgorithm.None)); 81var text = EmbeddedText.FromBytes("pathToEmpty", new ArraySegment<byte>(new byte[0], 0, 0), SourceHashAlgorithm.Sha1); 118var text = EmbeddedText.FromBytes("pathToSmall", new ArraySegment<byte>(bytes, 0, bytes.Length)); 133var text = EmbeddedText.FromBytes("pathToSmall", new ArraySegment<byte>(paddedBytes, 1, bytes.Length)); 160var text = EmbeddedText.FromBytes("pathToLarge", new ArraySegment<byte>(bytes, 0, bytes.Length), SourceHashAlgorithms.Default); 175var text = EmbeddedText.FromBytes("pathToLarge", new ArraySegment<byte>(paddedBytes, 1, bytes.Length), SourceHashAlgorithms.Default);
Microsoft.Data.Analysis (1)
DataFrame.cs (1)
355ArraySegment<int> segment = new ArraySegment<int>(shuffleArray, 0, shuffleLowerLimit);
Microsoft.DotNet.Build.Tasks.Installers (1)
src\RpmHeader.cs (1)
149entries.Add(new Entry(entry.Tag, entry.Type, new ArraySegment<byte>(store, entry.Offset, entry.Count)));
Microsoft.Extensions.Caching.Hybrid (2)
Internal\BufferChunk.cs (1)
87internal ArraySegment<byte> AsArraySegment() => Length == 0 ? default! : new(OversizedArray!, Offset, Length);
Internal\HybridCachePayload.cs (1)
305payload = new(source.Array!, start, payloadLength);
Microsoft.Extensions.Caching.Hybrid.Tests (9)
PayloadTests.cs (9)
56var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 85var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 91result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out payload, out remaining, out flags, out entropy, out pendingTags, out _); 121var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 151var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 157result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out payload, out remaining, out flags, out entropy, out pendingTags, out _); 189var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 238var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength - 1), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _); 265var result = HybridCachePayload.TryParse(new(oversized, 0, actualLength + 1), key, tags, cache, out var payload, out var remaining, out var flags, out var entropy, out var pendingTags, out _);
Microsoft.Extensions.Caching.SqlServer (3)
SqlParameterCollectionExtensions.cs (1)
35value = new([], 0, 0);
SqlServerCache.cs (2)
239return new([], 0, 0); 252return new(lease, 0, length);
Microsoft.Extensions.DependencyModel (1)
DependencyContextJsonReader.cs (1)
113return new ArraySegment<byte>(rented, 0, written);
Microsoft.Extensions.ServiceDiscovery.Dns (3)
Resolver\DnsResolver.cs (3)
696DnsDataReader responseReader = new DnsDataReader(new ArraySegment<byte>(buffer, 0, length), true); 744responseReader = new DnsDataReader(new ArraySegment<byte>(buffer, 0, packetLength), true); 809DnsDataReader responseReader = new DnsDataReader(new ArraySegment<byte>(buffer, 2, responseLength), true);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
Resolver\DnsDataReaderTests.cs (1)
60DnsDataReader reader = new DnsDataReader(new ArraySegment<byte>(buffer, 0, i));
Resolver\LoopbackDnsServer.cs (2)
60int bytesWritten = await ProcessRequestCore((IPEndPoint)result.RemoteEndPoint, new ArraySegment<byte>(buffer, 0, result.ReceivedBytes), action, buffer.AsMemory(0, 512)); 103int bytesWritten = await ProcessRequestCore((IPEndPoint)tcpClient.RemoteEndPoint!, new ArraySegment<byte>(buffer, 2, length), action, buffer.AsMemory(2));
Microsoft.Extensions.Telemetry (3)
Latency\Internal\CheckpointTracker.cs (1)
76public ArraySegment<Checkpoint> Checkpoints => new(_checkpoints, 0, _numCheckpoints);
Latency\Internal\MeasureTracker.cs (1)
132return new(_measures, 1, _numMeasures);
Latency\Internal\TagCollection.cs (1)
70public ArraySegment<Tag> Tags => new(_tags, 0, _numTags);
Microsoft.Extensions.Telemetry.Abstractions.Tests (3)
Latency\LatencyDataTests.cs (3)
44ArraySegment<Checkpoint> checkpoints = new ArraySegment<Checkpoint>(LatencyDataTests.GetCheckpoints(num), 1, numCheckpoints); 45ArraySegment<Measure> measures = new ArraySegment<Measure>(GetMeasures(num), 2, numMeasures); 46ArraySegment<Tag> tags = new ArraySegment<Tag>(GetTags(num), 3, numTags);
PresentationCore (1)
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
366return new List<T>(new ArraySegment<T>(array, 0, count));
Swaggatherer (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
System.Formats.Nrbf (1)
System\Formats\Nrbf\Utils\TypeNameHelpers.cs (1)
215return new ArraySegment<char>(rented, 0, length);
System.Memory (1)
System\Buffers\ReadOnlySequence.Helpers.cs (1)
550segment = new ArraySegment<T>((T[])_startObject, startIndex, GetIndex(_endInteger) - startIndex);
System.Private.CoreLib (9)
src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (2)
140return new ArraySegment<T>(_array!, _offset + index, _count - index); 152return new ArraySegment<T>(_array!, _offset + index, count);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (1)
194buffer = new ArraySegment<byte>(_buffer, offset: _origin, count: _length - _origin);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (2)
150return ReadSpan(new Span<byte>(buffer, offset, count), new ArraySegment<byte>(buffer, offset, count)); 468WriteSpan(new ReadOnlySpan<byte>(buffer, offset, count), new ArraySegment<byte>(buffer, offset, count));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (2)
290segment = new ArraySegment<T>(Unsafe.As<T[]>(obj), index & ReadOnlyMemory<T>.RemoveFlagsBitMask, length); 301segment = new ArraySegment<T>(tempArraySegment.Array!, tempArraySegment.Offset + index, length);
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (2)
268return new ArraySegment<byte>(bytes, 0, byteCount); 584ArraySegment<char> decodedChars = new ArraySegment<char>(scratchChars, 0, charsWritten);
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (1)
146return new ArraySegment<byte>(buffer, offset, count);
System\Xml\EncodingStreamWrapper.cs (2)
459seg = new ArraySegment<byte>(buffer, offset, count); 464seg = new ArraySegment<byte>(buffer, offset, count);
System.Private.Windows.Core (9)
System\Collections\Generic\CollectionExtensions.cs (1)
24return new List<T>(new ArraySegment<T>(array, 0, count));
System\Value.cs (8)
783? new(byteArray, _union.Segment.Offset, _union.Segment.Count) 784: new(byteArray, 0, 0); 799? new(charArray, _union.Segment.Offset, _union.Segment.Count) 800: new(charArray, 0, 0); 1004? (T)(object)new ArraySegment<char>(chars, _union.Segment.Offset, _union.Segment.Count) 1005: (T)(object)new ArraySegment<char>(chars, 0, 0); 1011? (T)(object)new ArraySegment<byte>(bytes, _union.Segment.Offset, _union.Segment.Count) 1012: (T)(object)new ArraySegment<byte>(bytes, 0, 0);
System.Private.Windows.Core.Tests (4)
System\Value\StoringArrays.cs (4)
49segment = new(b, 0, 0); 56segment = new(b, 1, 1); 77segment = new(b, 0, 0); 84segment = new(b, 1, 1);
System.Reflection.Metadata (1)
System\Reflection\Metadata\Blob.cs (1)
21public ArraySegment<byte> GetBytes() => new ArraySegment<byte>(Buffer, Start, Length);
System.Security.Cryptography.Pkcs (2)
src\libraries\Common\src\System\Security\Cryptography\Asn1Reader\AsnValueReader.cs (1)
255return new ArraySegment<byte>(rented, 0, written);
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (1)
374return new ArraySegment<byte>(decrypted, 0, decryptedBytes);
System.ServiceModel.NetFramingBase (3)
System\ServiceModel\Channels\FramingEncoders.cs (2)
236return new ArraySegment<byte>(buffer, messageFrame.Offset - spaceNeeded, messageFrame.Count + spaceNeeded); 320return new ArraySegment<byte>(buffer, offset, messageFrame.Count + spaceNeeded);
System\ServiceModel\Channels\SessionConnectionReader.cs (1)
277message = _messageEncoder.ReadMessage(new ArraySegment<byte>(EnvelopeBuffer, 0, EnvelopeSize), _bufferManager);
System.Text.Json (3)
System\Text\Json\Document\JsonDocument.cs (1)
851rented = new ArraySegment<byte>(rent, 0, written);
System\Text\Json\Document\JsonDocument.Parse.cs (2)
858return new ArraySegment<byte>(rented, 0, written); 940return new ArraySegment<byte>(rented, 0, written);
Templates.Blazor.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Blazor.WebAssembly.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Mvc.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Tests (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Wasm.Performance.ConsoleHost (1)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (1)
596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));