Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / _BufferOffsetSize.cs / 1305376 / _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
- XPathItem.cs
- TextSpan.cs
- StyleSheetDesigner.cs
- Function.cs
- SoapObjectInfo.cs
- KeyedCollection.cs
- Geometry.cs
- WebPartsSection.cs
- ApplicationServiceHelper.cs
- DesignerActionService.cs
- ConfigXmlCDataSection.cs
- ClientEndpointLoader.cs
- AutomationPeer.cs
- MDIClient.cs
- StorageBasedPackageProperties.cs
- ClientRoleProvider.cs
- ResponseStream.cs
- ReversePositionQuery.cs
- CacheVirtualItemsEvent.cs
- DBPropSet.cs
- StretchValidation.cs
- WebProxyScriptElement.cs
- RightsManagementInformation.cs
- DebugTrace.cs
- ThreadInterruptedException.cs
- TextReader.cs
- ProgressBarHighlightConverter.cs
- TogglePatternIdentifiers.cs
- MainMenu.cs
- RequestChannel.cs
- AddInControllerImpl.cs
- OleDbConnection.cs
- Span.cs
- UdpContractFilterBehavior.cs
- WindowPatternIdentifiers.cs
- HttpAsyncResult.cs
- DesignerCommandSet.cs
- TypeListConverter.cs
- SiteMapPath.cs
- BasicDesignerLoader.cs
- ApplicationManager.cs
- TrackingConditionCollection.cs
- BlockCollection.cs
- UnsignedPublishLicense.cs
- CacheVirtualItemsEvent.cs
- CopyAttributesAction.cs
- XmlSchemaExporter.cs
- BitmapCodecInfo.cs
- WindowsToolbarItemAsMenuItem.cs
- securitycriticaldata.cs
- ListenerConstants.cs
- DbProviderFactories.cs
- XmlFormatExtensionAttribute.cs
- SQLConvert.cs
- DeviceSpecificDesigner.cs
- XPathArrayIterator.cs
- SQLString.cs
- ResourcePermissionBase.cs
- TextSimpleMarkerProperties.cs
- StringSource.cs
- ValidationError.cs
- ComPlusContractBehavior.cs
- GenericXmlSecurityTokenAuthenticator.cs
- Transactions.cs
- StorageInfo.cs
- Wizard.cs
- Exceptions.cs
- ComponentChangingEvent.cs
- CacheEntry.cs
- DrawingContext.cs
- ValidationSummary.cs
- CheckBoxField.cs
- LinearGradientBrush.cs
- DifferencingCollection.cs
- DataGridAddNewRow.cs
- GeneratedContractType.cs
- GridViewColumn.cs
- Item.cs
- XmlTextReaderImplHelpers.cs
- StyleHelper.cs
- SourceFilter.cs
- RegexWorker.cs
- WebPartZoneBase.cs
- WebPartConnectionsCloseVerb.cs
- CardSpaceSelector.cs
- SystemUnicastIPAddressInformation.cs
- WebPartCatalogAddVerb.cs
- SHA256Cng.cs
- ChtmlSelectionListAdapter.cs
- StreamingContext.cs
- SslSecurityTokenParameters.cs
- ResourcePermissionBaseEntry.cs
- cookie.cs
- Rect.cs
- LocalIdKeyIdentifierClause.cs
- ArrangedElementCollection.cs
- ActivityBuilder.cs
- RuleSetDialog.Designer.cs
- TableCell.cs
- RelationshipWrapper.cs