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