514 instantiations of ArraySegment
AutobahnTestApp (3)
ClientSample (1)
dotnet-dev-certs (1)
dotnet-getdocument (1)
dotnet-openapi (1)
dotnet-sql-cache (1)
dotnet-svcutil-lib (27)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (10)
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);
1272_webSocket.ReceiveAsync(new ArraySegment<byte>(_initialReadBuffer.Array), cancelToken);
dotnet-user-jwts (1)
dotnet-user-secrets (1)
ExceptionHandlerSample (1)
Extensibility.MessageEncoder.IntegrationTests (1)
GenerateDocumentationAndConfigFiles (4)
GetDocument.Insider (1)
IIS.FunctionalTests (2)
IISExpress.FunctionalTests (2)
InMemory.FunctionalTests (2)
InProcessWebSite (5)
Startup.WebSockets.cs (5)
138await webSocket.SendAsync(new ArraySegment<byte>(Encoding.ASCII.GetBytes(message)), WebSocketMessageType.Text, true, CancellationToken.None);
166var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), token);
181await webSocket.SendAsync(new ArraySegment<byte>(buffer, 0, result.Count), result.MessageType, result.EndOfMessage, token);
182result = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), token);
215result = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None);
Metrics (4)
Metrics.Legacy (4)
Microsoft.AspNetCore.Components (2)
Microsoft.AspNetCore.Components.Authorization.Tests (1)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Microsoft.AspNetCore.Components.Forms.Tests (1)
Microsoft.AspNetCore.Components.QuickGrid.Tests (1)
Microsoft.AspNetCore.Components.Server (3)
Microsoft.AspNetCore.Components.Tests (1)
Microsoft.AspNetCore.Components.Web.Tests (1)
Microsoft.AspNetCore.Components.WebView (1)
Microsoft.AspNetCore.DataProtection (22)
Microsoft.AspNetCore.DataProtection.Tests (90)
Cng\CbcAuthenticatedEncryptorTests.cs (12)
24ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
25ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
29byte[] decipheredtext = encryptor.Decrypt(new ArraySegment<byte>(ciphertext), aad);
45ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
46ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
54encryptor.Decrypt(new ArraySegment<byte>(invalidCiphertext_tooShort), aad);
63encryptor.Decrypt(new ArraySegment<byte>(invalidCiphertext_manipulated), aad);
71encryptor.Decrypt(new ArraySegment<byte>(invalidCiphertext_tooLong), aad);
78encryptor.Decrypt(new ArraySegment<byte>(validCiphertext), new ArraySegment<byte>(Encoding.UTF8.GetBytes("different aad")));
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 (6)
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);
40var aad = new ArraySegment<byte>(new byte[0]);
64var ciphertext = new ArraySegment<byte>(new byte[0]);
65var aad = new ArraySegment<byte>(new byte[] { 0x10, 0x11, 0x12, 0x13, 0x14 }, 1, 4);
Cng\GcmAuthenticatedEncryptorTests.cs (12)
21ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
22ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
26byte[] decipheredtext = encryptor.Decrypt(new ArraySegment<byte>(ciphertext), aad);
39ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
40ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
48encryptor.Decrypt(new ArraySegment<byte>(invalidCiphertext_tooShort), aad);
57encryptor.Decrypt(new ArraySegment<byte>(invalidCiphertext_manipulated), aad);
65encryptor.Decrypt(new ArraySegment<byte>(invalidCiphertext_tooLong), aad);
72encryptor.Decrypt(new ArraySegment<byte>(validCiphertext), new ArraySegment<byte>(Encoding.UTF8.GetBytes("different aad")));
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 (12)
20ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
21ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
25byte[] decipheredtext = encryptor.Decrypt(new ArraySegment<byte>(ciphertext), aad);
40ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
41ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
49encryptor.Decrypt(new ArraySegment<byte>(invalidCiphertext_tooShort), aad);
58encryptor.Decrypt(new ArraySegment<byte>(invalidCiphertext_manipulated), aad);
66encryptor.Decrypt(new ArraySegment<byte>(invalidCiphertext_tooLong), aad);
73encryptor.Decrypt(new ArraySegment<byte>(validCiphertext), new ArraySegment<byte>(Encoding.UTF8.GetBytes("different aad")));
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 (8)
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);
82secret.WriteSecretIntoBuffer(new ArraySegment<byte>(new byte[0]));
121secret.WriteSecretIntoBuffer(new ArraySegment<byte>(new byte[0]));
143var outputSegment = new ArraySegment<byte>(new byte[7], 2, 3);
205testCode: () => secret.WriteSecretIntoBuffer(new ArraySegment<byte>(new byte[100])),
219testCode: () => secret.WriteSecretIntoBuffer(new ArraySegment<byte>(new byte[16])));
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Microsoft.AspNetCore.Http.Connections.Tests (2)
Microsoft.AspNetCore.Owin (1)
Microsoft.AspNetCore.Server.HttpSys (8)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (26)
Http1\Http1ConnectionTests.cs (15)
300await _http1Connection.WriteAsync(new ArraySegment<byte>(new byte[1]));
311await _http1Connection.WriteAsync(new ArraySegment<byte>(new byte[1]));
321await _http1Connection.WriteAsync(new ArraySegment<byte>(new byte[1]));
591await Assert.ThrowsAsync<InvalidOperationException>(() => _http1Connection.WriteAsync(new ArraySegment<byte>(new byte[1])));
602await Assert.ThrowsAsync<InvalidOperationException>(() => _http1Connection.WriteAsync(new ArraySegment<byte>(new byte[1]), default(CancellationToken)));
613await _http1Connection.WriteAsync(new ArraySegment<byte>(new byte[1]));
624await _http1Connection.WriteAsync(new ArraySegment<byte>(new byte[1]), default(CancellationToken));
679await _http1Connection.WriteAsync(new ArraySegment<byte>(new[] { (byte)ch }));
683await _http1Connection.WriteAsync(new ArraySegment<byte>(new[] { (byte)'d' }));
701await _http1Connection.WriteAsync(new ArraySegment<byte>(new[] { (byte)ch }), default(CancellationToken));
705await _http1Connection.WriteAsync(new ArraySegment<byte>(new[] { (byte)'d' }), default(CancellationToken));
756await _http1Connection.WriteAsyncAwaited(startingTask, new ArraySegment<byte>(new[] { (byte)'h' }), default(CancellationToken));
761await _http1Connection.WriteAsync(new ArraySegment<byte>(new[] { (byte)ch }), default(CancellationToken));
765await _http1Connection.WriteAsync(new ArraySegment<byte>(new[] { (byte)'d' }), default(CancellationToken));
780await _http1Connection.WriteAsync(new ArraySegment<byte>(Encoding.ASCII.GetBytes("hello, world")), default(CancellationToken));
MessageBodyTests.cs (10)
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));
608Assert.Equal(0, await stream.ReadAsync(new ArraySegment<byte>(new byte[1])));
667AssertASCII("Hello", new ArraySegment<byte>(buffer, 0, 5));
694AssertASCII("Hello", new ArraySegment<byte>(buffer, 0, 5));
Microsoft.AspNetCore.Shared.Tests (1)
Microsoft.AspNetCore.SignalR.Tests (4)
Microsoft.AspNetCore.SpaServices.Extensions (3)
Microsoft.AspNetCore.TestHost (4)
Microsoft.AspNetCore.TestHost.Tests (15)
TestClientTests.cs (15)
723var receiveResult = await websocket.ReceiveAsync(new System.ArraySegment<byte>(receiveArray), CancellationToken.None);
731var sendBuffer = new System.ArraySegment<byte>(receiveArray, 0, receiveResult.Count);
764await clientSocket.SendAsync(new System.ArraySegment<byte>(hello), WebSocketMessageType.Text, true, CancellationToken.None);
766await clientSocket.SendAsync(new System.ArraySegment<byte>(world), WebSocketMessageType.Binary, true, CancellationToken.None);
773var result = await clientSocket.ReceiveAsync(new System.ArraySegment<byte>(buffer), CancellationToken.None);
778result = await clientSocket.ReceiveAsync(new System.ArraySegment<byte>(buffer), CancellationToken.None);
783result = await clientSocket.ReceiveAsync(new System.ArraySegment<byte>(buffer), CancellationToken.None);
836var result = await clientSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None);
861var receiveResult = await websocket.ReceiveAsync(new ArraySegment<byte>(receiveArray), CancellationToken.None);
869var sendBuffer = new System.ArraySegment<byte>(receiveArray, 0, receiveResult.Count);
948await Assert.ThrowsAsync<IOException>(async () => await clientSocket.ReceiveAsync(new System.ArraySegment<byte>(buffer), CancellationToken.None));
965var receiveResult = await websocket.ReceiveAsync(new System.ArraySegment<byte>(receiveArray), CancellationToken.None);
966var sendBuffer = new System.ArraySegment<byte>(receiveArray, 0, receiveResult.Count);
988await clientSocket.SendAsync(new System.ArraySegment<byte>(hello), WebSocketMessageType.Text, true, CancellationToken.None);
995var result = await clientSocket.ReceiveAsync(new System.ArraySegment<byte>(buffer), CancellationToken.None);
Microsoft.AspNetCore.WebSockets.Tests (50)
SendReceiveTests.cs (11)
19await pair.ClientSocket.SendAsync(new ArraySegment<byte>(sendBuffer), WebSocketMessageType.Text, endOfMessage: true, cancellationToken: CancellationToken.None);
22var result = await pair.ServerSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
36await pair.ServerSocket.SendAsync(new ArraySegment<byte>(sendBuffer), WebSocketMessageType.Text, endOfMessage: true, cancellationToken: CancellationToken.None);
39var result = await pair.ClientSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
51await pair.ClientSocket.SendAsync(new ArraySegment<byte>(sendBuffer), WebSocketMessageType.Binary, endOfMessage: true, cancellationToken: CancellationToken.None);
54var result = await pair.ServerSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
66await pair.ServerSocket.SendAsync(new ArraySegment<byte>(sendBuffer), WebSocketMessageType.Binary, endOfMessage: true, cancellationToken: CancellationToken.None);
69var result = await pair.ClientSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
81await pair.ServerSocket.SendAsync(new ArraySegment<byte>(sendBuffer), WebSocketMessageType.Binary, endOfMessage: true, cancellationToken: CancellationToken.None);
84var result = await pair.ClientSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
94await pair.ClientSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), CancellationToken.None);
WebSocketMiddlewareTests.cs (35)
71var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
81await client.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
96var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
106await client.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
121var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
131await client.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
147var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
159await client.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
178var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
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);
226await webSocket.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
233var result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer), CancellationToken.None);
251await webSocket.SendAsync(new ArraySegment<byte>(originalData), WebSocketMessageType.Binary, true, CancellationToken.None);
258var result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer), CancellationToken.None);
276await webSocket.SendAsync(new ArraySegment<byte>(originalData), 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);
318var result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer), CancellationToken.None);
325new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None);
332new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None);
353var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
387var result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer), CancellationToken.None);
409var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
439var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
473var result = await webSocket.ReceiveAsync(new ArraySegment<byte>(serverBuffer), CancellationToken.None);
485var result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer), CancellationToken.None);
526var pendingResponse = serverSocket.ReceiveAsync(new ArraySegment<byte>(new byte[1024]), default);
532var response = await serverSocket.ReceiveAsync(new ArraySegment<byte>(new byte[1024]), default);
601var response = await serverSocket.ReceiveAsync(new ArraySegment<byte>(new byte[1024]), cts.Token);
Microsoft.AspNetCore.WebUtilities (1)
Microsoft.CodeAnalysis (9)
Microsoft.CodeAnalysis.Analyzers (4)
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
Microsoft.CodeAnalysis.BannedApiAnalyzers (4)
Microsoft.CodeAnalysis.CodeStyle (4)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.Features (2)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (4)
Microsoft.CodeAnalysis.PublicApiAnalyzers (4)
Microsoft.CodeAnalysis.ResxSourceGenerator (4)
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.CodeAnalysis.Workspaces (4)
Microsoft.Data.Analysis (1)
Microsoft.DotNet.Build.Tasks.Installers (2)
Microsoft.Extensions.Caching.Hybrid (2)
Microsoft.Extensions.Caching.Hybrid.Tests (10)
PayloadTests.cs (10)
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 _);
211var result = HybridCachePayload.TryParse(new(bytes), "whatever", TagSet.Empty, 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 (5)
Microsoft.Extensions.DependencyModel (1)
Microsoft.Extensions.Http.Diagnostics.Tests (3)
Latency\Internal\HttpClientLatencyLogEnricherTest.cs (3)
21var checkpoints = new ArraySegment<Checkpoint>(new[] { new Checkpoint("a", default, default), new Checkpoint("b", default, default) });
38var checkpoints = new ArraySegment<Checkpoint>(new[] { new Checkpoint("a", default, default), new Checkpoint("b", default, default) });
58var checkpoints = new ArraySegment<Checkpoint>(new[] { new Checkpoint("a", default, default), new Checkpoint("b", default, default) });
Microsoft.Extensions.Logging.EventSource (1)
Microsoft.Extensions.ServiceDiscovery.Dns (3)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
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)
Microsoft.Extensions.Telemetry.Abstractions (3)
Microsoft.Extensions.Telemetry.Abstractions.Tests (6)
Microsoft.Extensions.Telemetry.Tests (9)
PresentationCore (1)
Roslyn.Diagnostics.Analyzers (4)
Swaggatherer (1)
System.Formats.Nrbf (1)
System.Memory (1)
System.Net.Security (3)
System.Net.Sockets (5)
System\Net\Sockets\Socket.cs (2)
2592return TaskToAsyncResult.Begin(ReceiveAsync(new ArraySegment<byte>(buffer, offset, size), socketFlags, fromNetworkStream: false, default).AsTask(), callback, state);
2601Task<int> t = ReceiveAsync(new ArraySegment<byte>(buffer, offset, size), socketFlags, fromNetworkStream: false, default).AsTask();
System\Net\Sockets\UDPClient.cs (3)
573return _clientSocket.SendAsync(new ArraySegment<byte>(datagram, 0, bytes), SocketFlags.None);
578return _clientSocket.SendToAsync(new ArraySegment<byte>(datagram, 0, bytes), SocketFlags.None, endPoint);
620new ArraySegment<byte>(_buffer, 0, MaxUDPSize),
System.Net.WebSockets (4)
System.Private.CoreLib (11)
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));
System.Private.DataContractSerialization (5)
System.Private.Windows.Core (9)
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 (6)
System.Reflection.Metadata (1)
System.Security.Cryptography (10)
System.Security.Cryptography.Pkcs (2)
System.ServiceModel.Http (12)
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (10)
553new ArraySegment<byte>(internalBuffer, receivedByteCount, internalBuffer.Length - receivedByteCount),
739result = await _webSocket.ReceiveAsync(new ArraySegment<byte>(buffer, 0, _receiveBufferSize), cancelToken);
810new ArraySegment<byte>(buffer, 0, count),
821ArraySegment<byte> bytes = new ArraySegment<byte>(buffer, 0, count);
1032result = await _webSocket.ReceiveAsync(new ArraySegment<byte>(buffer, offset, count), cancellationToken);
1112await _webSocket.SendAsync(new ArraySegment<byte>(buffer, offset, count), _outgoingMessageType, false, cancellationToken);
1155Task task = _webSocket.SendAsync(new ArraySegment<byte>(Array.Empty<byte>(), 0, 0), _outgoingMessageType, true, timeoutHelper.GetCancellationToken());
1181await _webSocket.SendAsync(new ArraySegment<byte>(Array.Empty<byte>(), 0, 0), _outgoingMessageType, true, cancelToken);
1223_initialReadBuffer = new ArraySegment<byte>(_initialReadBuffer.Array, _initialReadBuffer.Offset + bytesToCopy, _initialReadBuffer.Count - bytesToCopy);
1244_webSocket.ReceiveAsync(new ArraySegment<byte>(_initialReadBuffer.Array), cancelToken);
System.ServiceModel.NetFramingBase (3)
System.ServiceModel.Primitives (8)
System.Text.Json (3)
Templates.Blazor.Tests (1)
Templates.Blazor.WebAssembly.Auth.Tests (1)
Templates.Blazor.WebAssembly.Tests (1)
Templates.Mvc.Tests (1)
Templates.Tests (1)
Test.Utilities (4)
Text.Analyzers (4)
Wasm.Performance.ConsoleHost (1)
WebSocketSample (2)
869 references to ArraySegment
ClientSample (6)
dotnet-svcutil-lib (69)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BinaryMessageEncoder.cs (8)
257ArraySegment<byte> buffer = this.Buffer;
381private ArraySegment<byte> AddSessionInformationToMessage(ArraySegment<byte> messageData, BufferManager bufferManager, int maxMessageSize)
437private ArraySegment<byte> ExtractSessionInformationFromMessage(ArraySegment<byte> messageData)
516public override Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType)
619public override ArraySegment<byte> WriteMessage(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset)
682ArraySegment<byte> messageData = messageWriter.WriteMessage(message, bufferManager, messageOffset, maxMessageSize);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingChannels.cs (8)
79ArraySegment<byte> messageData;
99protected override AsyncCompletionResult StartWritingBufferedMessage(Message message, ArraySegment<byte> messageData, bool allowOutputBatching, TimeSpan timeout, Action<object> callback, object state)
111protected override ArraySegment<byte> EncodeMessage(Message message)
113ArraySegment<byte> messageData = MessageEncoder.WriteMessage(message,
194private ArraySegment<byte> CreatePreamble()
241private async Task<IConnection> SendPreambleAsync(IConnection connection, ArraySegment<byte> preamble, TimeSpan timeout)
282private IConnection SendPreamble(IConnection connection, ArraySegment<byte> preamble, ref TimeoutHelper timeoutHelper)
415private ArraySegment<byte> _preamble;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncoder.cs (8)
42public virtual Task<Message> ReadMessageAsync(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType)
49public Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager)
55public abstract Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType);
58internal async Task<ArraySegment<byte>> BufferMessageStreamAsync(Stream stream, BufferManager bufferManager, int maxBufferSize)
115public ArraySegment<byte> WriteMessage(Message message, int maxMessageSize, BufferManager bufferManager)
117ArraySegment<byte> arraySegment = WriteMessage(message, maxMessageSize, bufferManager, 0);
121public abstract ArraySegment<byte> WriteMessage(Message message, int maxMessageSize,
130public virtual Task<ArraySegment<byte>> WriteMessageAsync(Message message, int maxMessageSize,
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TextMessageEncoder.cs (5)
401public override Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType)
461public override ArraySegment<byte> WriteMessage(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset)
471public override Task<ArraySegment<byte>> WriteMessageAsync(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset)
496ArraySegment<byte> messageData = messageWriter.WriteMessage(message, bufferManager, messageOffset, maxMessageSize);
716ArraySegment<byte> buffer = this.Buffer;
Extensibility.MessageEncoder.IntegrationTests (5)
GenerateDocumentationAndConfigFiles (7)
http2cat (3)
IIS.FunctionalTests (3)
IIS.LongTests (3)
IIS.NewHandler.FunctionalTests (3)
IIS.NewShim.FunctionalTests (3)
IIS.ShadowCopy.Tests (3)
IISExpress.FunctionalTests (3)
Interop.FunctionalTests (1)
KeyManagementSimulator (4)
Metrics (7)
Metrics.Legacy (7)
Microsoft.AspNetCore.Antiforgery (1)
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.Server (4)
Microsoft.AspNetCore.Components.WebView (4)
Microsoft.AspNetCore.Components.WebView.Test (6)
Infrastructure\TestDocument.cs (3)
198private int InsertFrame(RenderBatch batch, ContainerNode parent, int childIndex, ArraySegment<RenderTreeFrame> frames, RenderTreeFrame frame, int frameIndex)
270private int InsertFrameRange(RenderBatch batch, ContainerNode parent, int childIndex, ArraySegment<RenderTreeFrame> frames, int startIndex, int endIndexExcl)
286private void InsertElement(RenderBatch batch, ContainerNode parent, int childIndex, ArraySegment<RenderTreeFrame> frames, RenderTreeFrame frame, int frameIndex)
Microsoft.AspNetCore.DataProtection (38)
Microsoft.AspNetCore.DataProtection.Tests (56)
Cng\CbcAuthenticatedEncryptorTests.cs (6)
24ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
25ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
45ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
46ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
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 (6)
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);
40var aad = new ArraySegment<byte>(new byte[0]);
64var ciphertext = new ArraySegment<byte>(new byte[0]);
65var aad = new ArraySegment<byte>(new byte[] { 0x10, 0x11, 0x12, 0x13, 0x14 }, 1, 4);
Cng\GcmAuthenticatedEncryptorTests.cs (6)
21ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
22ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
39ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
40ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
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);
KeyManagement\KeyRingBasedDataProtectorTests.cs (24)
46.Setup(o => o.Encrypt(It.IsAny<ArraySegment<byte>>(), It.IsAny<ArraySegment<byte>>()))
47.Returns<ArraySegment<byte>, ArraySegment<byte>>((actualPlaintext, actualAad) =>
84.Setup(o => o.Encrypt(It.IsAny<ArraySegment<byte>>(), It.IsAny<ArraySegment<byte>>()))
85.Returns<ArraySegment<byte>, ArraySegment<byte>>((actualPlaintext, actualAad) =>
424.Setup(o => o.Decrypt(It.IsAny<ArraySegment<byte>>(), It.IsAny<ArraySegment<byte>>()))
425.Returns<ArraySegment<byte>, ArraySegment<byte>>((actualCiphertext, actualAad) =>
471.Setup(o => o.Decrypt(It.IsAny<ArraySegment<byte>>(), It.IsAny<ArraySegment<byte>>()))
472.Returns<ArraySegment<byte>, ArraySegment<byte>>((actualCiphertext, actualAad) =>
520.Setup(o => o.Decrypt(It.IsAny<ArraySegment<byte>>(), It.IsAny<ArraySegment<byte>>()))
521.Returns<ArraySegment<byte>, ArraySegment<byte>>((actualCiphertext, actualAad) =>
595.Setup(o => o.Encrypt(It.IsAny<ArraySegment<byte>>(), It.IsAny<ArraySegment<byte>>()))
596.Returns<ArraySegment<byte>, ArraySegment<byte>>((actualPlaintext, actualAad) =>
Managed\ManagedAuthenticatedEncryptorTests.cs (6)
20ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
21ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
40ArraySegment<byte> plaintext = new ArraySegment<byte>(Encoding.UTF8.GetBytes("plaintext"));
41ArraySegment<byte> aad = new ArraySegment<byte>(Encoding.UTF8.GetBytes("aad"));
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 (5)
15testCode: () => new Secret(default(ArraySegment<byte>)),
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);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Microsoft.AspNetCore.Http.Connections.Tests (2)
Microsoft.AspNetCore.Owin (9)
Microsoft.AspNetCore.Server.HttpSys (14)
RequestProcessing\ResponseBody.cs (7)
112private unsafe void FlushInternal(bool endOfRequest, ArraySegment<byte> data = new ArraySegment<byte>())
190private unsafe void BuildDataChunks(scoped ref UnmanagedBufferAllocator allocator, bool endOfRequest, ArraySegment<byte> data, out Span<HTTP_DATA_CHUNK> dataChunks, out Span<GCHandle> pins)
244var chunkHeaderBuffer = Helpers.GetChunkHeader(data.Count);
278ArraySegment<byte> buffer,
320private unsafe Task FlushInternalAsync(ArraySegment<byte> data, CancellationToken cancellationToken)
539var data = new ArraySegment<byte>(buffer, offset, count);
591var data = new ArraySegment<byte>(buffer, offset, count);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (3)
Microsoft.AspNetCore.Server.IIS (4)
Microsoft.AspNetCore.Server.Kestrel.Core (4)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (5)
Microsoft.AspNetCore.Shared.Tests (3)
Microsoft.AspNetCore.SignalR.Client.Tests (2)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (1)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
Microsoft.AspNetCore.SignalR.Tests (2)
Microsoft.AspNetCore.SpaServices.Extensions (2)
Microsoft.AspNetCore.TestHost (5)
Microsoft.AspNetCore.TestHost.Tests (3)
Microsoft.AspNetCore.Testing (1)
Microsoft.AspNetCore.WebSockets.Tests (1)
Microsoft.AspNetCore.WebUtilities (4)
Microsoft.CodeAnalysis (18)
Microsoft.CodeAnalysis.Analyzers (7)
Microsoft.CodeAnalysis.AnalyzerUtilities (7)
Microsoft.CodeAnalysis.BannedApiAnalyzers (7)
Microsoft.CodeAnalysis.CodeStyle (7)
Microsoft.CodeAnalysis.Collections.Package (3)
Microsoft.CodeAnalysis.CSharp (3)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
Microsoft.CodeAnalysis.Extensions.Package (4)
Microsoft.CodeAnalysis.Features (4)
Microsoft.CodeAnalysis.InteractiveHost (3)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (7)
Microsoft.CodeAnalysis.PublicApiAnalyzers (7)
Microsoft.CodeAnalysis.ResxSourceGenerator (7)
Microsoft.CodeAnalysis.Threading.Package (3)
Microsoft.CodeAnalysis.UnitTests (3)
Microsoft.CodeAnalysis.Workspaces (7)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (3)
Microsoft.Data.Analysis (2)
Microsoft.DotNet.Build.Tasks.Installers (6)
Microsoft.DotNet.SignCheckLibrary (1)
Microsoft.DotNet.SignTool (1)
Microsoft.Extensions.AI.Abstractions (2)
Microsoft.Extensions.AI.Abstractions.Tests (1)
Microsoft.Extensions.AI.OpenAI (1)
Microsoft.Extensions.Caching.Hybrid (5)
Microsoft.Extensions.Caching.Hybrid.Tests (10)
PayloadTests.cs (8)
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 _);
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 _);
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 _);
211var result = HybridCachePayload.TryParse(new(bytes), "whatever", TagSet.Empty, 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 (8)
Microsoft.Extensions.DependencyModel (2)
Microsoft.Extensions.Http.Diagnostics.Tests (3)
Latency\Internal\HttpClientLatencyLogEnricherTest.cs (3)
21var checkpoints = new ArraySegment<Checkpoint>(new[] { new Checkpoint("a", default, default), new Checkpoint("b", default, default) });
38var checkpoints = new ArraySegment<Checkpoint>(new[] { new Checkpoint("a", default, default), new Checkpoint("b", default, default) });
58var checkpoints = new ArraySegment<Checkpoint>(new[] { new Checkpoint("a", default, default), new Checkpoint("b", default, default) });
Microsoft.Extensions.Logging.AzureAppServices (3)
Microsoft.Extensions.Logging.EventSource (1)
Microsoft.Extensions.ServiceDiscovery.Dns (9)
Resolver\DnsResolver.cs (5)
303static bool TryReadTarget(in DnsResourceRecord record, ArraySegment<byte> messageBytes, out EncodedDomainName target)
313var gotArray = MemoryMarshal.TryGetArray(record.Data, out ArraySegment<byte> segment);
538Response = new DnsResponse(ArraySegment<byte>.Empty, header, queryStartedTime, queryStartedTime, null!, null!, null!),
551Response = new DnsResponse(ArraySegment<byte>.Empty, header, queryStartedTime, queryStartedTime, null!, null!, null!),
565Response = new DnsResponse(ArraySegment<byte>.Empty, header, queryStartedTime, queryStartedTime, null!, null!, null!),
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (1)
Microsoft.Extensions.Telemetry (3)
Microsoft.Extensions.Telemetry.Abstractions (9)
Microsoft.Extensions.Telemetry.Abstractions.Tests (6)
Microsoft.Extensions.Telemetry.Tests (10)
Microsoft.ML.Core (1)
Microsoft.ML.Data (6)
mscorlib (1)
netstandard (1)
Roslyn.Diagnostics.Analyzers (7)
Roslyn.Test.PdbUtilities (2)
System.Formats.Asn1 (1)
System.Formats.Nrbf (2)
System.Memory (3)
System.Net.HttpListener (4)
System.Net.Requests (3)
System.Net.Security (6)
System.Net.Sockets (66)
System\Net\Sockets\Socket.cs (10)
1117public int Send(IList<ArraySegment<byte>> buffers)
1124public int Send(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
1137public int Send(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
1604public int Receive(IList<ArraySegment<byte>> buffers)
1611public int Receive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
1624public int Receive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
2516public IAsyncResult BeginSend(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback? callback, object? state)
2525public IAsyncResult? BeginSend(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback? callback, object? state)
2613public IAsyncResult BeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback? callback, object? state)
2621public IAsyncResult? BeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback? callback, object? state)
System\Net\Sockets\Socket.Tasks.cs (17)
250public Task<int> ReceiveAsync(ArraySegment<byte> buffer) =>
259public Task<int> ReceiveAsync(ArraySegment<byte> buffer, SocketFlags socketFlags) => ReceiveAsync(buffer, socketFlags, fromNetworkStream: false);
261internal Task<int> ReceiveAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, bool fromNetworkStream)
309public Task<int> ReceiveAsync(IList<ArraySegment<byte>> buffers) =>
318public Task<int> ReceiveAsync(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
340public Task<SocketReceiveFromResult> ReceiveFromAsync(ArraySegment<byte> buffer, EndPoint remoteEndPoint) =>
350public Task<SocketReceiveFromResult> ReceiveFromAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint)
442public Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(ArraySegment<byte> buffer, EndPoint remoteEndPoint) =>
452public Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint)
501public Task<int> SendAsync(ArraySegment<byte> buffer) =>
510public Task<int> SendAsync(ArraySegment<byte> buffer, SocketFlags socketFlags)
573public Task<int> SendAsync(IList<ArraySegment<byte>> buffers) =>
582public Task<int> SendAsync(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
604public Task<int> SendToAsync(ArraySegment<byte> buffer, EndPoint remoteEP) =>
614public Task<int> SendToAsync(ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEP)
795private static void ValidateBuffer(ArraySegment<byte> buffer)
809private static void ValidateBuffersList(IList<ArraySegment<byte>> buffers)
System\Net\Sockets\SocketAsyncContext.Unix.cs (12)
395public IList<ArraySegment<byte>>? Buffers;
507public IList<ArraySegment<byte>>? Buffers;
562public IList<ArraySegment<byte>>? Buffers;
1739public SocketError Receive(IList<ArraySegment<byte>> buffers, SocketFlags flags, int timeout, out int bytesReceived)
1744public SocketError ReceiveAsync(IList<ArraySegment<byte>> buffers, SocketFlags flags, out int bytesReceived, out SocketFlags receivedFlags, Action<int, Memory<byte>, SocketFlags, SocketError> callback)
1749public SocketError ReceiveFrom(IList<ArraySegment<byte>> buffers, ref SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, int timeout, out int bytesReceived)
1781public SocketError ReceiveFromAsync(IList<ArraySegment<byte>> buffers, SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out SocketFlags receivedFlags, Action<int, Memory<byte>, SocketFlags, SocketError> callback)
1894public SocketError ReceiveMessageFromAsync(Memory<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, Memory<byte> socketAddress, out int socketAddressLen, bool isIPv4, bool isIPv6, out int bytesReceived, out SocketFlags receivedFlags, out IPPacketInformation ipPacketInformation, Action<int, Memory<byte>, SocketFlags, IPPacketInformation, SocketError> callback, CancellationToken cancellationToken = default)
2048public SocketError Send(IList<ArraySegment<byte>> buffers, SocketFlags flags, int timeout, out int bytesSent)
2053public SocketError SendAsync(IList<ArraySegment<byte>> buffers, SocketFlags flags, out int bytesSent, Action<int, Memory<byte>, SocketFlags, SocketError> callback)
2058public SocketError SendTo(IList<ArraySegment<byte>> buffers, SocketFlags flags, Memory<byte> socketAddress, int timeout, out int bytesSent)
2092public SocketError SendToAsync(IList<ArraySegment<byte>> buffers, SocketFlags flags, Memory<byte> socketAddress, out int bytesSent, Action<int, Memory<byte>, SocketFlags, SocketError> callback)
System\Net\Sockets\SocketPal.Unix.cs (13)
285private static unsafe int SysSend(SafeSocketHandle socket, SocketFlags flags, IList<ArraySegment<byte>> buffers, ref int bufferIndex, ref int offset, ReadOnlySpan<byte> socketAddress, out Interop.Error errno)
308ArraySegment<byte> buffer = buffers[startIndex + i];
380private static unsafe int SysReceive(SafeSocketHandle socket, SocketFlags flags, IList<ArraySegment<byte>> buffers, Span<byte> socketAddress, out int socketAddressLen, out SocketFlags receivedFlags, out Interop.Error errno)
421ArraySegment<byte> buffer = buffers[i];
539SafeSocketHandle socket, SocketFlags flags, IList<ArraySegment<byte>> buffers,
561ArraySegment<byte> buffer = buffers[i];
770public static bool TryCompleteReceiveFrom(SafeSocketHandle socket, IList<ArraySegment<byte>> buffers, SocketFlags flags, Span<byte> socketAddress, out int socketAddressLen, out int bytesReceived, out SocketFlags receivedFlags, out SocketError errorCode) =>
832public static unsafe bool TryCompleteReceiveFrom(SafeSocketHandle socket, Span<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, Span<byte> socketAddress, out int receivedSocketAddressLength, out int bytesReceived, out SocketFlags receivedFlags, out SocketError errorCode)
903public static bool TryCompleteReceiveMessageFrom(SafeSocketHandle socket, Span<byte> buffer, IList<ArraySegment<byte>>? buffers, SocketFlags flags, Memory<byte> socketAddress, out int receivedSocketAddressLength, bool isIPv4, bool isIPv6, out int bytesReceived, out SocketFlags receivedFlags, out IPPacketInformation ipPacketInformation, out SocketError errorCode)
961public static bool TryCompleteSendTo(SafeSocketHandle socket, IList<ArraySegment<byte>> buffers, ref int bufferIndex, ref int offset, SocketFlags flags, ReadOnlySpan<byte> socketAddress, ref int bytesSent, out SocketError errorCode)
967public static bool TryCompleteSendTo(SafeSocketHandle socket, ReadOnlySpan<byte> buffer, IList<ArraySegment<byte>>? buffers, ref int bufferIndex, ref int offset, ref int count, SocketFlags flags, ReadOnlySpan<byte> socketAddress, ref int bytesSent, out SocketError errorCode)
1178public static SocketError Send(SafeSocketHandle handle, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out int bytesTransferred)
1262public static SocketError Receive(SafeSocketHandle handle, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out int bytesTransferred)
System\Net\Sockets\SocketTaskExtensions.cs (7)
47public static Task<int> ReceiveAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags) =>
53public static Task<int> ReceiveAsync(this Socket socket, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags) =>
56public static Task<SocketReceiveFromResult> ReceiveFromAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint) =>
59public static Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEndPoint) =>
63public static Task<int> SendAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags) =>
69public static Task<int> SendAsync(this Socket socket, IList<ArraySegment<byte>> buffers, SocketFlags socketFlags) =>
73public static Task<int> SendToAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags, EndPoint remoteEP) =>
System.Net.WebSockets (10)
System.Net.WebSockets.Client (6)
System.Private.CoreLib (52)
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (8)
3722public static Span<T> AsSpan<T>(this ArraySegment<T> segment)
3739public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start)
3754public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Index startIndex)
3773public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start, int length)
3789public static Span<T> AsSpan<T>(this ArraySegment<T> segment, Range range)
3868public static Memory<T> AsMemory<T>(this ArraySegment<T> segment) => new Memory<T>(segment.Array, segment.Offset, segment.Count);
3881public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start)
3901public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start, int length)
System.Private.DataContractSerialization (10)
System.Private.Windows.Core (21)
System.Private.Windows.Core.Tests (22)
System\Value\StoringArrays.cs (22)
19Assert.Throws<InvalidCastException>(() => value.GetValue<ArraySegment<byte>>());
33Assert.Throws<InvalidCastException>(() => value.GetValue<ArraySegment<char>>());
42ArraySegment<byte> segment = new(b);
44Assert.Equal(typeof(ArraySegment<byte>), value.Type);
45Assert.Equal(segment, value.GetValue<ArraySegment<byte>>());
46Assert.Equal(segment, (ArraySegment<byte>)value.GetValue<object>());
51Assert.Equal(typeof(ArraySegment<byte>), value.Type);
52Assert.Equal(segment, value.GetValue<ArraySegment<byte>>());
53Assert.Equal(segment, (ArraySegment<byte>)value.GetValue<object>());
58Assert.Equal(typeof(ArraySegment<byte>), value.Type);
59Assert.Equal(segment, value.GetValue<ArraySegment<byte>>());
60Assert.Equal(segment, (ArraySegment<byte>)value.GetValue<object>());
70ArraySegment<char> segment = new(b);
72Assert.Equal(typeof(ArraySegment<char>), value.Type);
73Assert.Equal(segment, value.GetValue<ArraySegment<char>>());
74Assert.Equal(segment, (ArraySegment<char>)value.GetValue<object>());
79Assert.Equal(typeof(ArraySegment<char>), value.Type);
80Assert.Equal(segment, value.GetValue<ArraySegment<char>>());
81Assert.Equal(segment, (ArraySegment<char>)value.GetValue<object>());
86Assert.Equal(typeof(ArraySegment<char>), value.Type);
87Assert.Equal(segment, value.GetValue<ArraySegment<char>>());
88Assert.Equal(segment, (ArraySegment<char>)value.GetValue<object>());
System.Private.Xml (1)
System.Reflection.Metadata (2)
System.Runtime (1)
System.Runtime.InteropServices.JavaScript (6)
System.Security.Cryptography (37)
System.Security.Cryptography.Pkcs (11)
System.ServiceModel.Http (14)
System.ServiceModel.NetFramingBase (13)
System.ServiceModel.Primitives (40)
System\ServiceModel\Channels\BinaryMessageEncoder.cs (8)
233ArraySegment<byte> buffer = Buffer;
371private ArraySegment<byte> AddSessionInformationToMessage(ArraySegment<byte> messageData, BufferManager bufferManager, int maxMessageSize)
427private ArraySegment<byte> ExtractSessionInformationFromMessage(ArraySegment<byte> messageData)
506public override Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType)
609public override ArraySegment<byte> WriteMessage(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset)
672ArraySegment<byte> messageData = messageWriter.WriteMessage(message, bufferManager, messageOffset, maxMessageSize);
System\ServiceModel\Channels\MessageEncoder.cs (8)
45public virtual ValueTask<Message> ReadMessageAsync(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType)
52public Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager)
58public abstract Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType);
61internal async Task<ArraySegment<byte>> BufferMessageStreamAsync(Stream stream, BufferManager bufferManager, int maxBufferSize, CancellationToken cancellationToken)
118public ArraySegment<byte> WriteMessage(Message message, int maxMessageSize, BufferManager bufferManager)
123public abstract ArraySegment<byte> WriteMessage(Message message, int maxMessageSize,
132public virtual ValueTask<ArraySegment<byte>> WriteMessageAsync(Message message, int maxMessageSize,
135return new ValueTask<ArraySegment<byte>>(WriteMessage(message, maxMessageSize, bufferManager, messageOffset));
System\ServiceModel\Channels\MtomMessageEncoder.cs (7)
362public override Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType)
424public override ArraySegment<byte> WriteMessage(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset)
429public override ValueTask<ArraySegment<byte>> WriteMessageAsync(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset)
431return new ValueTask<ArraySegment<byte>>(WriteMessageInternal(message, maxMessageSize, bufferManager, messageOffset, GenerateStartInfoString(), _boundary, MtomStartUri));
449private ArraySegment<byte> WriteMessageInternal(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset, string startInfo, string boundary, string startUri)
484ArraySegment<byte> messageData = messageWriter.WriteMessage(message, bufferManager, messageOffset, maxMessageSize);
612ArraySegment<byte> buffer = Buffer;
System\ServiceModel\Channels\TextMessageEncoder.cs (6)
401public override Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType)
473public override ArraySegment<byte> WriteMessage(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset)
491public override ValueTask<ArraySegment<byte>> WriteMessageAsync(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset)
527ArraySegment<byte> messageData = messageWriter.WriteMessage(message, bufferManager, messageOffset, maxMessageSize);
544return new ValueTask<ArraySegment<byte>>(messageData);
754ArraySegment<byte> buffer = Buffer;
System.Text.Json (10)
System.Windows.Forms (1)
Test.Utilities (7)
Text.Analyzers (7)