Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Net / System / Net / _BufferOffsetSize.cs / 1 / _BufferOffsetSize.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { // // this class is used by the BeginMultipleSend() API // to allow a user to send multiple buffers on a socket // internal class BufferOffsetSize { // // internal members // internal byte[] Buffer; internal int Offset; internal int Size; internal BufferOffsetSize(byte[] buffer, int offset, int size, bool copyBuffer) { GlobalLog.Assert(buffer != null && buffer.Length >= size + offset, "BufferOffsetSize::.ctor|Illegal parameters."); if (copyBuffer) { byte[] newBuffer = new byte[size]; System.Buffer.BlockCopy( buffer, // src offset, // src index newBuffer, // dest 0, // dest index size ); // total size to copy offset = 0; buffer = newBuffer; } Buffer = buffer; Offset = offset; Size = size; GlobalLog.Print("BufferOffsetSize#" + ValidationHelper.HashString(this) + "::.ctor() copyBuffer:" + copyBuffer.ToString() + " this:[" + ToString() + "]"); } /* // Consider removing. internal BufferOffsetSize(byte[] buffer, int offset, bool copyBuffer) : this(buffer, offset, buffer.Length - offset, copyBuffer) { } */ /* // Consider removing. internal BufferOffsetSize(int size, byte[] buffer, bool copyBuffer) : this(buffer, 0, size, copyBuffer) { } */ internal BufferOffsetSize(byte[] buffer, bool copyBuffer) : this(buffer, 0, buffer.Length, copyBuffer) { } #if TRAVE public override string ToString() { return "BufferOffsetSize#" + ValidationHelper.HashString(this) + " Buffer#" + ValidationHelper.HashString(Buffer) + " Offset:" + Offset.ToString() + " Size:" + Size.ToString(); } #endif } // class BufferOffsetSize } // namespace System.Net // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { // // this class is used by the BeginMultipleSend() API // to allow a user to send multiple buffers on a socket // internal class BufferOffsetSize { // // internal members // internal byte[] Buffer; internal int Offset; internal int Size; internal BufferOffsetSize(byte[] buffer, int offset, int size, bool copyBuffer) { GlobalLog.Assert(buffer != null && buffer.Length >= size + offset, "BufferOffsetSize::.ctor|Illegal parameters."); if (copyBuffer) { byte[] newBuffer = new byte[size]; System.Buffer.BlockCopy( buffer, // src offset, // src index newBuffer, // dest 0, // dest index size ); // total size to copy offset = 0; buffer = newBuffer; } Buffer = buffer; Offset = offset; Size = size; GlobalLog.Print("BufferOffsetSize#" + ValidationHelper.HashString(this) + "::.ctor() copyBuffer:" + copyBuffer.ToString() + " this:[" + ToString() + "]"); } /* // Consider removing. internal BufferOffsetSize(byte[] buffer, int offset, bool copyBuffer) : this(buffer, offset, buffer.Length - offset, copyBuffer) { } */ /* // Consider removing. internal BufferOffsetSize(int size, byte[] buffer, bool copyBuffer) : this(buffer, 0, size, copyBuffer) { } */ internal BufferOffsetSize(byte[] buffer, bool copyBuffer) : this(buffer, 0, buffer.Length, copyBuffer) { } #if TRAVE public override string ToString() { return "BufferOffsetSize#" + ValidationHelper.HashString(this) + " Buffer#" + ValidationHelper.HashString(Buffer) + " Offset:" + Offset.ToString() + " Size:" + Size.ToString(); } #endif } // class BufferOffsetSize } // namespace System.Net // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProfilePropertySettingsCollection.cs
- ImageButton.cs
- XmlDataProvider.cs
- SchemaComplexType.cs
- DbConnectionClosed.cs
- DataControlCommands.cs
- HttpClientCertificate.cs
- Visitor.cs
- SafeFileMappingHandle.cs
- TextSpan.cs
- SerialStream.cs
- DocobjHost.cs
- OleDbDataReader.cs
- ConfigurationManagerHelper.cs
- TransactionChannelFaultConverter.cs
- SecurityException.cs
- arc.cs
- BlurEffect.cs
- CalendarTable.cs
- SequentialWorkflowHeaderFooter.cs
- WebRequestModulesSection.cs
- ProjectionPruner.cs
- DataObjectPastingEventArgs.cs
- DataSourceSerializationException.cs
- FontUnitConverter.cs
- DateRangeEvent.cs
- CustomAttributeBuilder.cs
- XmlBufferReader.cs
- ConnectionsZone.cs
- FormViewCommandEventArgs.cs
- PenLineCapValidation.cs
- InputReferenceExpression.cs
- XmlNodeList.cs
- FixedSOMImage.cs
- DesignOnlyAttribute.cs
- XdrBuilder.cs
- UpDownBase.cs
- SafeTimerHandle.cs
- ProviderUtil.cs
- ProcessInputEventArgs.cs
- ping.cs
- DataRelationPropertyDescriptor.cs
- OdbcDataAdapter.cs
- ScriptIgnoreAttribute.cs
- FileBasedResourceGroveler.cs
- SweepDirectionValidation.cs
- X509Utils.cs
- FullTextBreakpoint.cs
- ResetableIterator.cs
- AssertHelper.cs
- Quad.cs
- BuildProvider.cs
- UriTemplateTrieLocation.cs
- Application.cs
- CmsInterop.cs
- SqlUDTStorage.cs
- MenuItemStyleCollection.cs
- StateChangeEvent.cs
- MatchAttribute.cs
- ColumnMap.cs
- HMAC.cs
- SqlComparer.cs
- ProjectedSlot.cs
- CurrencyWrapper.cs
- FormDesigner.cs
- IISUnsafeMethods.cs
- CodeTypeParameterCollection.cs
- Pen.cs
- MouseButton.cs
- OrderedDictionary.cs
- BlockExpression.cs
- ResourcesChangeInfo.cs
- FamilyTypeface.cs
- SchemaImporterExtensionsSection.cs
- XmlSchemaSet.cs
- ChameleonKey.cs
- UTF7Encoding.cs
- RelationshipNavigation.cs
- DataGridViewImageColumn.cs
- DataExpression.cs
- EventToken.cs
- RequestCacheValidator.cs
- ToolStripRenderEventArgs.cs
- TdsParserSessionPool.cs
- SafeRightsManagementSessionHandle.cs
- _LocalDataStore.cs
- ObjectViewQueryResultData.cs
- HttpListenerResponse.cs
- TextEditorThreadLocalStore.cs
- DocumentAutomationPeer.cs
- MultipleViewProviderWrapper.cs
- HMACMD5.cs
- DateTimeStorage.cs
- RadioButtonBaseAdapter.cs
- METAHEADER.cs
- ForEachAction.cs
- Int32Converter.cs
- MexHttpsBindingCollectionElement.cs
- DataMemberConverter.cs
- XmlParserContext.cs