158 references to Array
mscorlib (2)
system\arraysegment.cs (2)
294
Contract.Requires(arraySegment.
Array
!= null);
297
Contract.Requires(arraySegment.Offset + arraySegment.Count <= arraySegment.
Array
.Length);
System (49)
net\System\Net\Internal.cs (2)
934
if (segment == null || segment.
Array
== null) {
939
|| segment.Count > (segment.
Array
.Length - segment.Offset)) {
net\System\Net\Sockets\_OverlappedAsyncResult.cs (2)
157
objectsToPin[i] = buffersCopy[i].
Array
;
164
m_WSABuffers[i].Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(buffersCopy[i].
Array
, buffersCopy[i].Offset);
net\System\Net\Sockets\Socket.cs (6)
1337
objectsToPin[i] = GCHandle.Alloc(buffer.
Array
, GCHandleType.Pinned);
1339
WSABuffers[i].Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(buffer.
Array
, buffer.Offset);
1873
objectsToPin[i] = GCHandle.Alloc(buffer.
Array
, GCHandleType.Pinned);
1875
WSABuffers[i].Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(buffer.
Array
, buffer.Offset);
9581
m_ObjectsToPin[i] = tempList[i].
Array
;
9603
m_WSABufferArray[i].Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(localCopy.
Array
, localCopy.Offset);
net\System\Net\WebSockets\WebSocketBase.cs (7)
250
buffer.
Array
,
367
buffer.
Array
,
418
await m_InnerStream.WriteAsync(buffer.
Array
,
927
closeMessageBuffer.
Array
,
1751
Task<int> readTask = m_WebSocket.m_InnerStream.ReadAsync(payload.
Array
,
2040
Buffer.BlockCopy(payload.
Array
,
2042
buffer.Value.
Array
,
net\System\Net\WebSockets\WebSocketBuffer.cs (23)
73
m_GCHandle = GCHandle.Alloc(internalBuffer.
Array
, GCHandleType.Pinned);
76
m_StartAddress = Marshal.UnsafeAddrOfPinnedArrayElement(internalBuffer.
Array
, internalBuffer.Offset).ToInt64();
78
m_NativeBuffer = new ArraySegment<byte>(internalBuffer.
Array
, internalBuffer.Offset, nativeBufferSize);
79
m_PayloadBuffer = new ArraySegment<byte>(internalBuffer.
Array
,
82
m_PropertyBuffer = new ArraySegment<byte>(internalBuffer.
Array
,
198
WebSocketHelpers.ValidateBuffer(payload.
Array
, payload.Offset, payload.Count);
209
m_PinnedSendBufferHandle = GCHandle.Alloc(m_PinnedSendBuffer.
Array
, GCHandleType.Pinned);
212
Marshal.UnsafeAddrOfPinnedArrayElement(m_PinnedSendBuffer.
Array
, m_PinnedSendBuffer.Offset).ToInt64();
219
return ConvertPinnedSendPayloadToNative(payload.
Array
, payload.Offset, payload.Count);
232
Contract.Assert(Marshal.UnsafeAddrOfPinnedArrayElement(m_PinnedSendBuffer.
Array
,
250
Contract.Assert(Marshal.UnsafeAddrOfPinnedArrayElement(m_PinnedSendBuffer.
Array
,
261
return new ArraySegment<byte>(m_PinnedSendBuffer.
Array
, m_PinnedSendBuffer.Offset + internalOffset, (int)bufferSize);
272
return object.ReferenceEquals(buffer, m_PinnedSendBuffer.
Array
) &&
331
Buffer.BlockCopy(payload.
Array
,
333
m_PayloadBuffer.
Array
,
351
Buffer.BlockCopy(m_PayloadBuffer.
Array
,
353
buffer.
Array
,
392
return new ArraySegment<byte>(m_InternalBuffer.
Array
,
424
reasonBlob = new ArraySegment<byte>(m_InternalBuffer.
Array
,
438
reason = Encoding.UTF8.GetString(reasonBlob.
Array
, reasonBlob.Offset, reasonBlob.Count);
606
Contract.Assert(m_NativeBuffer.
Array
!= null, "'m_NativeBuffer.Array' MUST NOT be NULL.");
611
return object.ReferenceEquals(buffer, m_NativeBuffer.
Array
) &&
633
Contract.Assert(Marshal.UnsafeAddrOfPinnedArrayElement(m_InternalBuffer.
Array
, m_InternalBuffer.Offset).ToInt64() == m_StartAddress,
net\System\Net\WebSockets\WebSocketConnectionStream.cs (2)
337
Logging.Dump(Logging.WebSockets, this, Methods.MultipleWriteAsync, buffer.
Array
, buffer.Offset, buffer.Count);
609
buffers[index] = new BufferOffsetSize(sendBuffer.
Array
, sendBuffer.Offset, sendBuffer.Count, false);
net\System\Net\WebSockets\WebSocketHelpers.cs (3)
544
if (arraySegment.
Array
== null)
549
if (arraySegment.Offset < 0 || arraySegment.Offset > arraySegment.
Array
.Length)
553
if (arraySegment.Count < 0 || arraySegment.Count > (arraySegment.
Array
.Length - arraySegment.Offset))
net\System\Net\WebSockets\WebSocketHttpListenerDuplexStream.cs (4)
353
return WriteAsync(buffer.
Array
, buffer.Offset, buffer.Count, cancellationToken);
1143
UpdateDataChunk(0, m_BufferList[0].
Array
, m_BufferList[0].Offset, m_BufferList[0].Count);
1144
UpdateDataChunk(1, m_BufferList[1].
Array
, m_BufferList[1].Offset, m_BufferList[1].Count);
1242
Logging.Dump(Logging.WebSockets, this, Methods.WriteAsyncFast, buffer.
Array
, buffer.Offset, buffer.Count);
System.Activities.DurableInstancing (9)
System\Activities\DurableInstancing\CorrelationKey.cs (1)
53
if (this.BinaryData.
Array
!= null)
System\Activities\DurableInstancing\CreateWorkflowOwnerAsyncResult.cs (4)
93
parameters.Add(new SqlParameter { ParameterName = "@primitiveLockOwnerData", SqlDbType = SqlDbType.VarBinary, Size = properties[0].Count, Value = (object)(properties[0].
Array
) ?? DBNull.Value });
94
parameters.Add(new SqlParameter { ParameterName = "@complexLockOwnerData", SqlDbType = SqlDbType.VarBinary, Size = properties[1].Count, Value = (object)(properties[1].
Array
) ?? DBNull.Value });
95
parameters.Add(new SqlParameter { ParameterName = "@writeOnlyPrimitiveLockOwnerData", SqlDbType = SqlDbType.VarBinary, Size = properties[2].Count, Value = (object)(properties[2].
Array
) ?? DBNull.Value });
96
parameters.Add(new SqlParameter { ParameterName = "@writeOnlyComplexLockOwnerData", SqlDbType = SqlDbType.VarBinary, Size = properties[3].Count, Value = (object)(properties[3].
Array
) ?? DBNull.Value });
System\Activities\DurableInstancing\SaveWorkflowAsyncResult.cs (3)
193
object parameterValue = (parameterSize == -1 ? SaveWorkflowAsyncResult.GenerateByteArray(source) : source.
Array
) ?? (object)DBNull.Value;
199
if (source.
Array
!= null)
202
Buffer.BlockCopy(source.
Array
, 0, destination, 0, source.Count);
System\Activities\DurableInstancing\SerializationUtilities.cs (1)
36
Buffer.BlockCopy(correlationKey.BinaryData.
Array
, 0, concatenatedBlob, Convert.ToInt32(insertLocation), Convert.ToInt32(correlationKey.BinaryData.Count));
System.IO.Log (6)
System\IO\Log\AppendHelper.cs (2)
43
handles[i + 1] = GCHandle.Alloc(data[i].
Array
, GCHandleType.Pinned);
45
blobs[i + 1].pBlobData = Marshal.UnsafeAddrOfPinnedArrayElement(data[i].
Array
, data[i].Offset);
System\IO\Log\LogReserveAndAppendState.cs (3)
489
this.pinnedObjects[(int)PinIndex.FirstData + i] = segment.
Array
;
490
this.handles[(int)PinIndex.FirstData + i] = GCHandle.Alloc(segment.
Array
, GCHandleType.Pinned);
491
this.writeEntries[entryIndex].Buffer = Marshal.UnsafeAddrOfPinnedArrayElement(segment.
Array
, segment.Offset);
System\IO\Log\LogWriteRestartAreaState.cs (1)
382
Array.Copy(segment.
Array
,
System.Runtime.Serialization (2)
System\Runtime\Serialization\Json\XmlJsonReader.cs (1)
845
BufferReader.SetBuffer(seg.
Array
, seg.Offset, seg.Count, null, null);
System\Xml\XmlUTF8TextReader.cs (1)
317
BufferReader.SetBuffer(seg.
Array
, seg.Offset, seg.Count, null, null);
System.ServiceModel (58)
System\ServiceModel\Channels\BinaryMessageEncoder.cs (6)
323
((IXmlBinaryReaderInitializer)xmlReader).SetInput(buffer.
Array
, buffer.Offset, buffer.Count,
331
xmlReader = XmlDictionaryReader.CreateBinaryReader(buffer.
Array
, buffer.Offset, buffer.Count,
480
byte[] buffer = messageData.
Array
;
540
byte[] buffer = messageData.
Array
;
652
message = messagePatterns.TryCreateMessage(buffer.
Array
, buffer.Offset, buffer.Count, bufferManager, messageData);
805
XmlDictionaryReader xmlDictionaryReader = XmlDictionaryReader.CreateBinaryReader(messageData.
Array
, messageData.Offset, messageData.Count, XD.Dictionary, XmlDictionaryReaderQuotas.Max, this.readerSessionForLogging, null);
System\ServiceModel\Channels\BufferedMessageData.cs (1)
71
bufferManager.ReturnBuffer(buffer.
Array
);
System\ServiceModel\Channels\Connection.cs (1)
933
ValidateBufferBounds(buffer.
Array
, buffer.Offset, buffer.Count);
System\ServiceModel\Channels\FramingChannels.cs (4)
90
this.Connection.Write(messageData.
Array
, messageData.Offset, messageData.Count, !allowOutputBatching,
107
return this.Connection.BeginWrite(messageData.
Array
, messageData.Offset, messageData.Count,
259
connection.Write(preamble.
Array
, preamble.Offset, preamble.Count, true, timeoutHelper.RemainingTime());
458
preamble.
Array
, preamble.Offset, preamble.Count,
System\ServiceModel\Channels\FramingEncoders.cs (2)
227
byte[] buffer = messageFrame.
Array
;
312
byte[] buffer = messageFrame.
Array
;
System\ServiceModel\Channels\HttpChannelHelpers.cs (12)
186
byte[] buffer = messageBuffer.
Array
;
713
IAsyncResult result = inputStream.BeginRead(buffer.
Array
, offset, count, onRead, this);
743
IAsyncResult result = inputStream.BeginRead(buffer.
Array
, offset, count, onRead, this);
763
this.message = this.httpInput.DecodeBufferedMessage(new ArraySegment<byte>(buffer.
Array
, 0, offset), inputStream);
1358
httpResponseMessage.Content = new HttpOutputByteArrayContent(messageBytes.
Array
, messageBytes.Offset, messageBytes.Count, this.bufferManager);
1485
this.bufferToRecycle = result.
Array
;
1600
this.bufferManager.ReturnBuffer(this.content.
Array
);
1912
outputStream.Write(buffer.
Array
, buffer.Offset, buffer.Count);
1923
outputStream.Write(buffer.
Array
, buffer.Offset, buffer.Count);
1984
outputStream.Write(buffer.
Array
, buffer.Offset, buffer.Count);
1995
outputStream.Write(buffer.
Array
, buffer.Offset, buffer.Count);
2181
httpOutput.outputStream.BeginWrite(buffer.
Array
, buffer.Offset, buffer.Count, onWriteBody, this);
System\ServiceModel\Channels\MessageBuffer.cs (1)
216
stream.Write(buffer.
Array
, buffer.Offset, buffer.Count);
System\ServiceModel\Channels\MessageEncoderCompressionHandler.cs (6)
18
MemoryStream memoryStream = new MemoryStream(buffer.
Array
, buffer.Offset, buffer.Count);
23
bufferedOutStream.Write(buffer.
Array
, 0, buffer.Offset);
53
bufferManager.ReturnBuffer(buffer.
Array
);
62
bufferedOutStream.Write(buffer.
Array
, 0, buffer.Offset);
68
ds.Write(buffer.
Array
, buffer.Offset, buffer.Count);
73
bufferManager.ReturnBuffer(buffer.
Array
);
System\ServiceModel\Channels\MsmqOutputChannel.cs (2)
145
Buffer.BlockCopy(preamble, 0, messageData.
Array
, messageData.Offset - preamble.Length, preamble.Length);
147
byte[] buffer = messageData.
Array
;
System\ServiceModel\Channels\MsmqOutputSessionChannel.cs (2)
60
Buffer.BlockCopy(buffer.
Array
, buffer.Offset, sessionGramBuffer, sessionGramOffset, buffer.Count);
70
this.Factory.BufferManager.ReturnBuffer(this.buffers[i].
Array
);
System\ServiceModel\Channels\MtomMessageEncoder.cs (5)
356
XmlDictionaryReader xmlDictionaryReader = XmlDictionaryReader.CreateMtomReader(messageData.
Array
, messageData.Offset, messageData.Count, MtomMessageEncoderFactory.GetSupportedEncodings(), contentType, XmlDictionaryReaderQuotas.Max, int.MaxValue, null);
648
((IXmlMtomReaderInitializer)xmlReader).SetInput(buffer.
Array
, buffer.Offset, buffer.Count, MtomMessageEncoderFactory.GetSupportedEncodings(), ContentType, this.Quotas, this.messageEncoder.MaxBufferSize, onClose);
652
xmlReader = XmlDictionaryReader.CreateMtomReader(buffer.
Array
, buffer.Offset, buffer.Count, MtomMessageEncoderFactory.GetSupportedEncodings(), ContentType, this.Quotas, this.messageEncoder.MaxBufferSize, onClose);
663
((IXmlTextReaderInitializer)xmlReader).SetInput(buffer.
Array
, buffer.Offset, buffer.Count, TextMessageEncoderFactory.GetEncodingFromContentType(ContentType, this.messageEncoder.contentEncodingMap), this.Quotas, onClose);
667
xmlReader = XmlDictionaryReader.CreateTextReader(buffer.
Array
, buffer.Offset, buffer.Count, TextMessageEncoderFactory.GetEncodingFromContentType(ContentType, this.messageEncoder.contentEncodingMap), this.Quotas, onClose);
System\ServiceModel\Channels\SingletonConnectionReader.cs (5)
1643
Buffer.BlockCopy(envelopeStartBytes, 0, messageData.
Array
, messageData.Offset - envelopeStartBytes.Length,
1645
connection.Write(messageData.
Array
, messageData.Offset - envelopeStartBytes.Length,
1790
this.bufferToFree = messageData.
Array
;
1791
Buffer.BlockCopy(envelopeStartBytes, 0, messageData.
Array
, messageData.Offset - envelopeStartBytes.Length,
1799
connection.BeginWrite(messageData.
Array
, messageData.Offset - envelopeStartBytes.Length,
System\ServiceModel\Channels\TextMessageEncoder.cs (3)
503
XmlDictionaryReader xmlDictionaryReader = XmlDictionaryReader.CreateTextReader(messageData.
Array
, messageData.Offset, messageData.Count, null, XmlDictionaryReaderQuotas.Max, null);
842
xmlReader = XmlDictionaryReader.CreateTextReader(buffer.
Array
, buffer.Offset, buffer.Count, this.encoding, this.Quotas, onClose);
850
((IXmlTextReaderInitializer)xmlReader).SetInput(buffer.
Array
, buffer.Offset, buffer.Count, this.encoding, this.Quotas, onClose);
System\ServiceModel\Channels\TransportDuplexSessionChannel.cs (1)
1180
this.buffer = messageData.
Array
;
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (5)
356
this.BufferManager.ReturnBuffer(messageData.
Array
);
1448
Buffer.BlockCopy(this.initialReadBuffer.
Array
, this.initialReadBuffer.Offset, buffer, offset, bytesToCopy);
1449
this.initialReadBuffer = new ArraySegment<byte>(this.initialReadBuffer.
Array
, this.initialReadBuffer.Offset + bytesToCopy, this.initialReadBuffer.Count - bytesToCopy);
1468
Task<WebSocketReceiveResult> receiveTask = this.webSocket.ReceiveAsync(new ArraySegment<byte>(this.initialReadBuffer.
Array
), CancellationToken.None);
1488
this.bufferManager.ReturnBuffer(this.initialReadBuffer.
Array
);
System\ServiceModel\Diagnostics\MessageLogTraceRecord.cs (1)
56
this.messageString = System.Text.Encoding.UTF8.GetString(buffer.
Array
, buffer.Offset, buffer.Count);
System\ServiceModel\Security\CryptoHelper.cs (1)
249
cipherText = encrTransform.TransformFinalBlock(plainText.
Array
, plainText.Offset, plainText.Count);
System.ServiceModel.Channels (26)
System\ServiceModel\Channels\ByteStreamBufferedMessageData.cs (4)
24
if (buffer.
Array
== null)
63
if (this.bufferManager != null && this.buffer.
Array
!= null)
65
this.bufferManager.ReturnBuffer(this.buffer.
Array
);
92
: base(byteStreamBufferedMessageData.Buffer.
Array
, byteStreamBufferedMessageData.Buffer.Offset, byteStreamBufferedMessageData.Buffer.Count, false)
System\ServiceModel\Channels\ByteStreamMessage.cs (2)
32
if (buffer.
Array
== null)
449
writer.WriteBase64(this.bufferedMessageData.Buffer.
Array
, this.bufferedMessageData.Buffer.Offset, this.bufferedMessageData.Buffer.Count);
System\ServiceModel\Channels\ByteStreamMessageEncoder.cs (1)
96
if (buffer.
Array
== null)
System\ServiceModel\Channels\DuplicateMessageDetector.cs (1)
47
hash = this.hashAlgorithm.ComputeHash(msgBytes.
Array
, msgBytes.Offset, msgBytes.Count);
System\ServiceModel\Channels\UdpChannelBase.cs (2)
164
continueReceiving = this.EnqueueMessage(message, data.
Array
.Length, onMessageDequeuedCallback);
194
this.BufferManager.ReturnBuffer(data.
Array
);
System\ServiceModel\Channels\UdpChannelListener.cs (2)
188
continueReceiving = Dispatch(message, data.
Array
.Length, onMessageDequeuedCallback);
242
localBufferManager.ReturnBuffer(data.
Array
);
System\ServiceModel\Channels\UdpOutputChannel.cs (7)
143
using (XmlDictionaryReader xmlDictionaryReader = XmlDictionaryReader.CreateTextReader(messageData.
Array
, messageData.Offset, messageData.Count, null, XmlDictionaryReaderQuotas.Max, null))
275
this.BufferManager.ReturnBuffer(messageData.
Array
);
416
Fx.Assert(messageBytes.
Array
!= null, "message data array can't be null");
428
sockets[i].SendTo(messageBytes.
Array
, messageBytes.Offset, messageBytes.Count, remoteEndpoint);
793
this.messageData.
Array
,
924
if (this.messageData.
Array
!= null)
926
this.channel.BufferManager.ReturnBuffer(this.messageData.
Array
);
System\ServiceModel\Channels\UdpSocket.cs (2)
374
IAsyncResult socketAsyncResult = this.socket.BeginReceiveFrom(this.Buffer.
Array
,
474
return new ArraySegment<byte>(this.Buffer.
Array
, this.Buffer.Offset, count);
System\ServiceModel\Channels\UdpSocketReceiveManager.cs (3)
290
Array.Copy(receiveBuffer.
Array
, receiveBuffer.Offset, dataBuffer, 0, dataLength);
291
this.receiveBufferPool.Return(receiveBuffer.
Array
);
355
Fx.Assert(messageBytes.
Array
== state.ReceiveBuffer, "Array returned by Socket.EndReceiveFrom must match the array passed in through the UdpSocketReceiveState");
System\ServiceModel\Channels\XmlBufferedByteStreamReader.cs (2)
55
Buffer.BlockCopy(this.bufferedMessageData.Buffer.
Array
, this.offset, buffer, index, bytesToCopy);
65
Buffer.BlockCopy(this.bufferedMessageData.Buffer.
Array
, this.bufferedMessageData.Buffer.Offset, buffer, 0, bytesToCopy);
System.ServiceModel.Web (3)
System\ServiceModel\Channels\JsonMessageEncoderFactory.cs (3)
292
messageData.
Array
, messageData.Offset, messageData.Count, null, XmlDictionaryReaderQuotas.Max, null);
533
xmlReader = JsonReaderWriterFactory.CreateJsonReader(buffer.
Array
, buffer.Offset, buffer.Count, this.encoding, this.Quotas, onClose);
537
((IXmlJsonReaderInitializer)xmlReader).SetInput(buffer.
Array
, buffer.Offset, buffer.Count, this.encoding, this.Quotas, onClose);
System.Web (3)
Util\PinnedArraySegment.cs (3)
32
segment = new ArraySegment<T>(segment.
Array
, segment.Offset, segment.Count);
34
_gcHandle = GCHandle.Alloc(segment.
Array
, GCHandleType.Pinned); // pin the array so that unmanaged code can access it
35
_pointer = Marshal.UnsafeAddrOfPinnedArrayElement(segment.
Array
, segment.Offset);