Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- AppDomainFactory.cs
- Aggregates.cs
- PrintController.cs
- UpdateTranslator.cs
- VisualCollection.cs
- Material.cs
- __Filters.cs
- SQLBinary.cs
- ClientSettings.cs
- DocumentPageView.cs
- TreeView.cs
- And.cs
- Pen.cs
- EmissiveMaterial.cs
- SecurityPolicySection.cs
- BitmapEffectState.cs
- BufferedGraphics.cs
- DataGridItemCollection.cs
- ToolstripProfessionalRenderer.cs
- WebAdminConfigurationHelper.cs
- DataObjectAttribute.cs
- TreeViewDesigner.cs
- DelegatingTypeDescriptionProvider.cs
- JournalEntryStack.cs
- TableLayoutStyle.cs
- CodeBinaryOperatorExpression.cs
- TransactionContextValidator.cs
- DataTemplateKey.cs
- EqualityComparer.cs
- TypeRefElement.cs
- XmlSchemaAppInfo.cs
- BounceEase.cs
- CustomErrorCollection.cs
- DataControlField.cs
- PenLineCapValidation.cs
- TextTrailingCharacterEllipsis.cs
- SizeKeyFrameCollection.cs
- FontCacheLogic.cs
- TextRenderer.cs
- Soap12FormatExtensions.cs
- WindowsAltTab.cs
- Version.cs
- WebPartConnectionsEventArgs.cs
- PLINQETWProvider.cs
- EntityExpressionVisitor.cs
- SchemaInfo.cs
- Vector3D.cs
- CqlLexer.cs
- XmlKeywords.cs
- HostSecurityManager.cs
- StringConverter.cs
- RecognizedPhrase.cs
- SizeAnimationBase.cs
- StorageAssociationSetMapping.cs
- ReadWriteSpinLock.cs
- BitmapEncoder.cs
- SingleAnimationUsingKeyFrames.cs
- XmlSchemaAttributeGroup.cs
- StylusSystemGestureEventArgs.cs
- ScriptControlManager.cs
- CultureInfoConverter.cs
- Image.cs
- Math.cs
- DesignerDeviceConfig.cs
- wgx_commands.cs
- QilXmlWriter.cs
- ObjectIDGenerator.cs
- PriorityChain.cs
- SpellerStatusTable.cs
- GlobalItem.cs
- Normalization.cs
- CaseInsensitiveHashCodeProvider.cs
- CollectionChange.cs
- isolationinterop.cs
- ImageSource.cs
- CodePageUtils.cs
- _UncName.cs
- XmlSchema.cs
- MissingSatelliteAssemblyException.cs
- FastPropertyAccessor.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ToolStripDropDownItem.cs
- TraceSwitch.cs
- GenericAuthenticationEventArgs.cs
- Calendar.cs
- AffineTransform3D.cs
- WebPartDisplayModeCollection.cs
- DebugController.cs
- DetailsViewInsertedEventArgs.cs
- WSFederationHttpBindingCollectionElement.cs
- InkCanvasSelection.cs
- CompositionTarget.cs
- HiddenField.cs
- DrawingCollection.cs
- CanExecuteRoutedEventArgs.cs
- XPathAncestorIterator.cs
- Method.cs
- VisualTreeUtils.cs
- ConstraintCollection.cs
- ScriptIgnoreAttribute.cs