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
- SerializationObjectManager.cs
- CodeChecksumPragma.cs
- RegisteredExpandoAttribute.cs
- InputGestureCollection.cs
- NavigationPropertySingletonExpression.cs
- PropertyStore.cs
- CellRelation.cs
- SafeUserTokenHandle.cs
- Point3DAnimationUsingKeyFrames.cs
- PathSegmentCollection.cs
- AdCreatedEventArgs.cs
- EventItfInfo.cs
- CapabilitiesAssignment.cs
- DelegatingTypeDescriptionProvider.cs
- uribuilder.cs
- AssemblyAttributesGoHere.cs
- ToolStripItemEventArgs.cs
- MailAddressCollection.cs
- ToolBarButtonDesigner.cs
- BulletDecorator.cs
- SizeAnimation.cs
- ContextMenuStrip.cs
- WorkflowTerminatedException.cs
- DatatypeImplementation.cs
- UpdatableWrapper.cs
- SqlUtil.cs
- PolicyLevel.cs
- ToolStripLocationCancelEventArgs.cs
- CultureTableRecord.cs
- FrameworkContentElement.cs
- PartitionerStatic.cs
- FillRuleValidation.cs
- RuntimeCompatibilityAttribute.cs
- EventlogProvider.cs
- ListChunk.cs
- selecteditemcollection.cs
- DateTimeFormatInfo.cs
- HostingPreferredMapPath.cs
- WebPartHelpVerb.cs
- EdmType.cs
- Hex.cs
- StateInitializationDesigner.cs
- DesignConnection.cs
- ProcessModelSection.cs
- RegisteredScript.cs
- XmlDataSource.cs
- EastAsianLunisolarCalendar.cs
- EntityDataSourceChangingEventArgs.cs
- SystemTcpStatistics.cs
- Collection.cs
- QilTypeChecker.cs
- LongTypeConverter.cs
- FacetValueContainer.cs
- TextBoxBaseDesigner.cs
- TypeConverterMarkupExtension.cs
- TakeOrSkipWhileQueryOperator.cs
- FilterEventArgs.cs
- ProfileEventArgs.cs
- ResourceSetExpression.cs
- ClientRoleProvider.cs
- ReadOnlyDataSource.cs
- UserControlBuildProvider.cs
- CopyCodeAction.cs
- InternalSafeNativeMethods.cs
- XmlDataCollection.cs
- GcSettings.cs
- JsonMessageEncoderFactory.cs
- Parser.cs
- Point3DKeyFrameCollection.cs
- HttpListenerElement.cs
- DetailsViewUpdatedEventArgs.cs
- BitmapSourceSafeMILHandle.cs
- _NegoStream.cs
- AnonymousIdentificationSection.cs
- dtdvalidator.cs
- UIElementParagraph.cs
- ProxyManager.cs
- X509AsymmetricSecurityKey.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- PaintValueEventArgs.cs
- DifferencingCollection.cs
- WorkflowFormatterBehavior.cs
- ScriptComponentDescriptor.cs
- InstalledVoice.cs
- TypeDelegator.cs
- Point4D.cs
- ConditionBrowserDialog.cs
- CacheDependency.cs
- OperatingSystem.cs
- Triplet.cs
- DifferencingCollection.cs
- Effect.cs
- UserControlCodeDomTreeGenerator.cs
- TextTreeRootTextBlock.cs
- DragDrop.cs
- WeakReferenceList.cs
- TiffBitmapDecoder.cs
- ApplyImportsAction.cs
- InternalBase.cs
- MgmtConfigurationRecord.cs