132 references to Offset
mscorlib (2)
system\arraysegment.cs (2)
295Contract.Requires(arraySegment.Offset >= 0); 297Contract.Requires(arraySegment.Offset + arraySegment.Count <= arraySegment.Array.Length);
System (50)
net\System\Net\Internal.cs (2)
938if (segment.Offset < 0 || segment.Count < 0 939|| segment.Count > (segment.Array.Length - segment.Offset)) {
net\System\Net\Sockets\_OverlappedAsyncResult.cs (1)
164m_WSABuffers[i].Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(buffersCopy[i].Array, buffersCopy[i].Offset);
net\System\Net\Sockets\Socket.cs (3)
1339WSABuffers[i].Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(buffer.Array, buffer.Offset); 1875WSABuffers[i].Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(buffer.Array, buffer.Offset); 9603m_WSABufferArray[i].Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(localCopy.Array, localCopy.Offset);
net\System\Net\WebSockets\WebSocketBase.cs (8)
251buffer.Offset, 368buffer.Offset, 372int position = buffer.Offset; 419buffer.Offset, 928closeMessageBuffer.Offset, 1752payload.Offset, 2041payload.Offset, 2043buffer.Value.Offset,
net\System\Net\WebSockets\WebSocketBuffer.cs (27)
76m_StartAddress = Marshal.UnsafeAddrOfPinnedArrayElement(internalBuffer.Array, internalBuffer.Offset).ToInt64(); 78m_NativeBuffer = new ArraySegment<byte>(internalBuffer.Array, internalBuffer.Offset, nativeBufferSize); 80m_NativeBuffer.Offset + m_NativeBuffer.Count, 83m_PayloadBuffer.Offset + m_PayloadBuffer.Count, 142int offset = m_PropertyBuffer.Offset; 147Marshal.WriteIntPtr(internalBufferPtr, offset, internalBufferPtr + m_InternalBuffer.Offset); 156offset = m_PropertyBuffer.Offset; 198WebSocketHelpers.ValidateBuffer(payload.Array, payload.Offset, payload.Count); 212Marshal.UnsafeAddrOfPinnedArrayElement(m_PinnedSendBuffer.Array, m_PinnedSendBuffer.Offset).ToInt64(); 219return ConvertPinnedSendPayloadToNative(payload.Array, payload.Offset, payload.Count); 233m_PinnedSendBuffer.Offset).ToInt64() == m_PinnedSendBufferStartAddress, 236return new IntPtr(m_PinnedSendBufferStartAddress + offset - m_PinnedSendBuffer.Offset); 251m_PinnedSendBuffer.Offset).ToInt64() == m_PinnedSendBufferStartAddress, 261return new ArraySegment<byte>(m_PinnedSendBuffer.Array, m_PinnedSendBuffer.Offset + internalOffset, (int)bufferSize); 273offset >= m_PinnedSendBuffer.Offset && 274offset + count <= m_PinnedSendBuffer.Offset + m_PinnedSendBuffer.Count; 332payload.Offset + unconsumedDataOffset, 334m_PayloadBuffer.Offset, 352m_PayloadBuffer.Offset + m_PayloadOffset, 354buffer.Offset, 438reason = Encoding.UTF8.GetString(reasonBlob.Array, reasonBlob.Offset, reasonBlob.Count); 589int offset = (int)(pBuffer.ToInt64() - m_StartAddress + m_InternalBuffer.Offset); 612offset >= m_NativeBuffer.Offset && 613offset + count <= m_NativeBuffer.Offset + m_NativeBuffer.Count; 619Contract.Assert(m_StartAddress + offset - m_InternalBuffer.Offset <= m_EndAddress, "'offset' is TOO BIG."); 621return new IntPtr(m_StartAddress + offset - m_InternalBuffer.Offset); 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)
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.IO.Log (3)
System\IO\Log\AppendHelper.cs (1)
45blobs[i + 1].pBlobData = Marshal.UnsafeAddrOfPinnedArrayElement(data[i].Array, data[i].Offset);
System\IO\Log\LogReserveAndAppendState.cs (1)
491this.writeEntries[entryIndex].Buffer = Marshal.UnsafeAddrOfPinnedArrayElement(segment.Array, segment.Offset);
System\IO\Log\LogWriteRestartAreaState.cs (1)
383segment.Offset,
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 (59)
System\ServiceModel\Channels\BinaryMessageEncoder.cs (15)
323((IXmlBinaryReaderInitializer)xmlReader).SetInput(buffer.Array, buffer.Offset, buffer.Count, 331xmlReader = XmlDictionaryReader.CreateBinaryReader(buffer.Array, buffer.Offset, buffer.Count, 491int messageSize = messageData.Offset + messageData.Count; 503int requiredBufferSize = messageData.Offset + messageData.Count + dictionarySize; 507Buffer.BlockCopy(buffer, messageData.Offset, newBuffer, messageData.Offset, messageData.Count); 512Buffer.BlockCopy(buffer, messageData.Offset, buffer, messageData.Offset + dictionarySize, messageData.Count); 514int offset = messageData.Offset; 527int newOffset = messageData.Offset - headerSize; 549headerSize = decoder.Decode(buffer, messageData.Offset, messageData.Count); 555newOffset = messageData.Offset + headerSize + dictionarySize; 579int offset = messageData.Offset + headerSize; 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\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 (5)
220int offset = messageFrame.Offset - spaceNeeded; 224messageFrame.Offset, SR.GetString(SR.SpaceNeededExceedsMessageFrameOffset, spaceNeeded))); 230return new ArraySegment<byte>(buffer, messageFrame.Offset - spaceNeeded, messageFrame.Count + spaceNeeded); 305int offset = messageFrame.Offset - spaceNeeded; 309messageFrame.Offset, SR.GetString(SR.SpaceNeededExceedsMessageFrameOffset, spaceNeeded)));
System\ServiceModel\Channels\HttpChannelHelpers.cs (6)
1358httpResponseMessage.Content = new HttpOutputByteArrayContent(messageBytes.Array, messageBytes.Offset, messageBytes.Count, this.bufferManager); 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 (8)
18MemoryStream memoryStream = new MemoryStream(buffer.Array, buffer.Offset, buffer.Count); 23bufferedOutStream.Write(buffer.Array, 0, buffer.Offset); 54buffer = new ArraySegment<byte>(decompressedBytes, buffer.Offset, length - buffer.Offset); 62bufferedOutStream.Write(buffer.Array, 0, buffer.Offset); 68ds.Write(buffer.Array, buffer.Offset, buffer.Count); 74buffer = new ArraySegment<byte>(compressedBytes, buffer.Offset, length - buffer.Offset);
System\ServiceModel\Channels\MsmqOutputChannel.cs (2)
145Buffer.BlockCopy(preamble, 0, messageData.Array, messageData.Offset - preamble.Length, preamble.Length); 148int offset = messageData.Offset - preamble.Length;
System\ServiceModel\Channels\MsmqOutputSessionChannel.cs (1)
60Buffer.BlockCopy(buffer.Array, buffer.Offset, sessionGramBuffer, sessionGramOffset, buffer.Count);
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 (4)
1643Buffer.BlockCopy(envelopeStartBytes, 0, messageData.Array, messageData.Offset - envelopeStartBytes.Length, 1645connection.Write(messageData.Array, messageData.Offset - envelopeStartBytes.Length, 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\WebSocketTransportDuplexSessionChannel.cs (2)
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);
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 (11)
System\ServiceModel\Channels\ByteStreamBufferedMessageData.cs (1)
92: base(byteStreamBufferedMessageData.Buffer.Array, byteStreamBufferedMessageData.Buffer.Offset, byteStreamBufferedMessageData.Buffer.Count, false)
System\ServiceModel\Channels\ByteStreamMessage.cs (1)
449writer.WriteBase64(this.bufferedMessageData.Buffer.Array, this.bufferedMessageData.Buffer.Offset, this.bufferedMessageData.Buffer.Count);
System\ServiceModel\Channels\DuplicateMessageDetector.cs (1)
47hash = this.hashAlgorithm.ComputeHash(msgBytes.Array, msgBytes.Offset, msgBytes.Count);
System\ServiceModel\Channels\UdpOutputChannel.cs (3)
143using (XmlDictionaryReader xmlDictionaryReader = XmlDictionaryReader.CreateTextReader(messageData.Array, messageData.Offset, messageData.Count, null, XmlDictionaryReaderQuotas.Max, null)) 428sockets[i].SendTo(messageBytes.Array, messageBytes.Offset, messageBytes.Count, remoteEndpoint); 794this.messageData.Offset,
System\ServiceModel\Channels\UdpSocket.cs (2)
375this.Buffer.Offset, 474return new ArraySegment<byte>(this.Buffer.Array, this.Buffer.Offset, count);
System\ServiceModel\Channels\UdpSocketReceiveManager.cs (1)
290Array.Copy(receiveBuffer.Array, receiveBuffer.Offset, dataBuffer, 0, dataLength);
System\ServiceModel\Channels\XmlBufferedByteStreamReader.cs (2)
24this.offset = bufferedMessageData.Buffer.Offset; 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 (2)
Util\PinnedArraySegment.cs (2)
32segment = new ArraySegment<T>(segment.Array, segment.Offset, segment.Count); 35_pointer = Marshal.UnsafeAddrOfPinnedArrayElement(segment.Array, segment.Offset);