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
- MeasureData.cs
- DataKeyCollection.cs
- ExpressionBuilderContext.cs
- CommentAction.cs
- DescendantOverDescendantQuery.cs
- ToolStripAdornerWindowService.cs
- _DomainName.cs
- MessageOperationFormatter.cs
- CroppedBitmap.cs
- FontSizeConverter.cs
- ResourceProviderFactory.cs
- CDSsyncETWBCLProvider.cs
- RequestCachePolicy.cs
- SessionStateUtil.cs
- SiteMapNodeItemEventArgs.cs
- dataprotectionpermissionattribute.cs
- SystemGatewayIPAddressInformation.cs
- UIElementParagraph.cs
- StrokeSerializer.cs
- LinqExpressionNormalizer.cs
- OleDbMetaDataFactory.cs
- XmlSerializationReader.cs
- GradientBrush.cs
- BitmapCodecInfoInternal.cs
- _ContextAwareResult.cs
- ResourceProperty.cs
- GlyphRunDrawing.cs
- TableChangeProcessor.cs
- FormatControl.cs
- ZipIOExtraFieldZip64Element.cs
- QuadraticEase.cs
- DataGridViewCellValidatingEventArgs.cs
- RectangleGeometry.cs
- PropertyMapper.cs
- RuleRefElement.cs
- activationcontext.cs
- BrowserDefinition.cs
- AssociationSet.cs
- ProfileModule.cs
- PackageDigitalSignatureManager.cs
- TokenBasedSet.cs
- Collection.cs
- cookiecollection.cs
- CompositeFontParser.cs
- SqlDataAdapter.cs
- XmlDictionaryWriter.cs
- EntitySqlException.cs
- OLEDB_Util.cs
- LicenseProviderAttribute.cs
- StaticContext.cs
- __ComObject.cs
- Validator.cs
- SerialErrors.cs
- XmlSecureResolver.cs
- TemplatePagerField.cs
- IdentityNotMappedException.cs
- QuaternionConverter.cs
- AnonymousIdentificationModule.cs
- CodeIdentifiers.cs
- _UriSyntax.cs
- DocumentCollection.cs
- WsdlEndpointConversionContext.cs
- EmptyReadOnlyDictionaryInternal.cs
- SelectingProviderEventArgs.cs
- HttpStreamFormatter.cs
- CheckableControlBaseAdapter.cs
- InternalConfigHost.cs
- ControlBindingsCollection.cs
- ActivatableWorkflowsQueryResult.cs
- ToolStripSeparatorRenderEventArgs.cs
- ErrorFormatter.cs
- Matrix.cs
- AssemblyInfo.cs
- KerberosTicketHashIdentifierClause.cs
- PKCS1MaskGenerationMethod.cs
- HwndSourceKeyboardInputSite.cs
- SingleAnimationUsingKeyFrames.cs
- ResourceDisplayNameAttribute.cs
- EventSinkHelperWriter.cs
- EntityConnectionStringBuilderItem.cs
- PrivilegedConfigurationManager.cs
- OleDbConnectionInternal.cs
- MsmqIntegrationBindingCollectionElement.cs
- TextDecorationCollectionConverter.cs
- PrintingPermission.cs
- DynamicPropertyReader.cs
- StyleModeStack.cs
- backend.cs
- PrivilegeNotHeldException.cs
- AttributeInfo.cs
- RenderDataDrawingContext.cs
- WinInetCache.cs
- EventMemberCodeDomSerializer.cs
- HtmlInputReset.cs
- RefExpr.cs
- ScrollChangedEventArgs.cs
- UserControl.cs
- CheckoutException.cs
- IndexedSelectQueryOperator.cs
- validation.cs