Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DbDataReader.cs
- StateWorkerRequest.cs
- Transform3DGroup.cs
- XmlNodeWriter.cs
- EntityDataSourceMemberPath.cs
- ListSortDescription.cs
- RIPEMD160.cs
- PropertiesTab.cs
- PolygonHotSpot.cs
- GridSplitter.cs
- HtmlTableCell.cs
- LoginName.cs
- CatalogZone.cs
- SignatureDescription.cs
- XhtmlBasicImageAdapter.cs
- DrawingServices.cs
- oledbmetadatacolumnnames.cs
- TextEndOfLine.cs
- oledbmetadatacolumnnames.cs
- GetParentChain.cs
- Evidence.cs
- CorrelationValidator.cs
- SocketInformation.cs
- Select.cs
- dataprotectionpermission.cs
- DesignBindingPropertyDescriptor.cs
- VersionedStreamOwner.cs
- ListBox.cs
- QuestionEventArgs.cs
- UnsafeNativeMethods.cs
- SafeHandle.cs
- ApplicationTrust.cs
- ToolStripRenderer.cs
- BamlRecords.cs
- Byte.cs
- GridItem.cs
- ADMembershipUser.cs
- DataGridCellEditEndingEventArgs.cs
- MetadataItemEmitter.cs
- ProtectedConfigurationSection.cs
- ButtonColumn.cs
- ProfileParameter.cs
- DataServiceExpressionVisitor.cs
- Int32Storage.cs
- MarkedHighlightComponent.cs
- GeometryHitTestResult.cs
- Line.cs
- TextRangeSerialization.cs
- TimeSpanSecondsConverter.cs
- XamlInterfaces.cs
- ArgumentNullException.cs
- BackStopAuthenticationModule.cs
- DynamicMetaObject.cs
- MissingSatelliteAssemblyException.cs
- ElapsedEventArgs.cs
- CharacterHit.cs
- WpfWebRequestHelper.cs
- PropertyTabAttribute.cs
- XmlNode.cs
- ExclusiveCanonicalizationTransform.cs
- VarInfo.cs
- LifetimeServices.cs
- InputLangChangeRequestEvent.cs
- BitmapEffectInput.cs
- TPLETWProvider.cs
- AlignmentYValidation.cs
- TextTrailingCharacterEllipsis.cs
- BooleanAnimationUsingKeyFrames.cs
- MetadataItem.cs
- DialogResultConverter.cs
- precedingsibling.cs
- WebPartZoneCollection.cs
- TimeSpanSecondsConverter.cs
- SerializationTrace.cs
- AmbiguousMatchException.cs
- ClientSettingsSection.cs
- TableLayoutPanel.cs
- DeclaredTypeValidator.cs
- Walker.cs
- Verify.cs
- PersonalizationProviderHelper.cs
- CodeMethodInvokeExpression.cs
- SmtpTransport.cs
- DeclarationUpdate.cs
- PolicyManager.cs
- WebHeaderCollection.cs
- ToolStripProgressBar.cs
- Keywords.cs
- ToolStripRendererSwitcher.cs
- ListChangedEventArgs.cs
- DesignerActionVerbItem.cs
- DriveInfo.cs
- IsolatedStorage.cs
- TypeUsage.cs
- remotingproxy.cs
- AccessedThroughPropertyAttribute.cs
- ValueType.cs
- SByte.cs
- ConstraintCollection.cs
- SecurityHelper.cs