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
- AttributeUsageAttribute.cs
- WarningException.cs
- TextLine.cs
- MasterPage.cs
- Label.cs
- RecordsAffectedEventArgs.cs
- XsdBuilder.cs
- QualifierSet.cs
- CannotUnloadAppDomainException.cs
- IPipelineRuntime.cs
- XsltLibrary.cs
- GeneralTransformCollection.cs
- Span.cs
- CustomAttributeBuilder.cs
- FamilyTypefaceCollection.cs
- MimeMultiPart.cs
- RegisteredHiddenField.cs
- ScriptResourceAttribute.cs
- XmlCharacterData.cs
- ToolStripSeparatorRenderEventArgs.cs
- SQLUtility.cs
- ChineseLunisolarCalendar.cs
- Group.cs
- TextCompositionManager.cs
- XmlSecureResolver.cs
- NetworkInformationException.cs
- ProgressBarHighlightConverter.cs
- CellIdBoolean.cs
- GeneralTransform3DTo2D.cs
- DataGridViewColumn.cs
- EntityProviderServices.cs
- XmlDocumentFragment.cs
- DefaultSection.cs
- XmlSchemaValidationException.cs
- WebPartMenuStyle.cs
- EmptyStringExpandableObjectConverter.cs
- StoreItemCollection.cs
- SocketInformation.cs
- MethodToken.cs
- VideoDrawing.cs
- MetadataSource.cs
- ObjectDisposedException.cs
- ConfigurationValue.cs
- AppDomainUnloadedException.cs
- XPathSingletonIterator.cs
- uribuilder.cs
- SqlClientWrapperSmiStreamChars.cs
- WebPartEditorCancelVerb.cs
- UIElementCollection.cs
- DrawingAttributes.cs
- DetailsViewDeletedEventArgs.cs
- MemberAccessException.cs
- RuleSetCollection.cs
- PackageRelationshipCollection.cs
- GridErrorDlg.cs
- ResourceDisplayNameAttribute.cs
- DispatcherHooks.cs
- Identity.cs
- GenericPrincipal.cs
- StringDictionaryWithComparer.cs
- DoubleAnimationUsingPath.cs
- LocalIdKeyIdentifierClause.cs
- PseudoWebRequest.cs
- DocumentOrderQuery.cs
- BmpBitmapEncoder.cs
- EventData.cs
- DbProviderFactories.cs
- ContextMenuService.cs
- DateTime.cs
- EntityRecordInfo.cs
- GeometryValueSerializer.cs
- Padding.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- SystemGatewayIPAddressInformation.cs
- RepeaterCommandEventArgs.cs
- RuntimeEnvironment.cs
- Vector3DAnimation.cs
- SecurityDocument.cs
- TypeElement.cs
- NullableIntMinMaxAggregationOperator.cs
- System.Data_BID.cs
- BaseAsyncResult.cs
- DataGridViewColumnTypeEditor.cs
- URLIdentityPermission.cs
- InstallerTypeAttribute.cs
- SafeSecurityHandles.cs
- DoWhile.cs
- DialogResultConverter.cs
- ImageSourceConverter.cs
- RuntimeEnvironment.cs
- ApplyImportsAction.cs
- DoubleLinkListEnumerator.cs
- Debug.cs
- TreeNodeConverter.cs
- Vector.cs
- AsymmetricSignatureFormatter.cs
- FieldDescriptor.cs
- MarkupProperty.cs
- AbandonedMutexException.cs
- AssociationTypeEmitter.cs