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