Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- CodeDirectoryCompiler.cs
- RIPEMD160Managed.cs
- AutomationIdentifier.cs
- ProfilePropertySettingsCollection.cs
- ChannelTraceRecord.cs
- ReflectionServiceProvider.cs
- Renderer.cs
- FixedDocument.cs
- ToolZone.cs
- GroupBox.cs
- Sql8ConformanceChecker.cs
- PreProcessor.cs
- OracleBFile.cs
- EntryPointNotFoundException.cs
- ProtocolsSection.cs
- FileSystemWatcher.cs
- FixedBufferAttribute.cs
- TokenCreationException.cs
- ReadOnlyKeyedCollection.cs
- StateManagedCollection.cs
- ListBox.cs
- BooleanExpr.cs
- DataServiceKeyAttribute.cs
- OptionUsage.cs
- UserPreferenceChangedEventArgs.cs
- ApplicationServiceManager.cs
- CookielessHelper.cs
- GenericArgumentsUpdater.cs
- WebPartDisplayMode.cs
- WindowsClientElement.cs
- TextBoxAutomationPeer.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- ToolTip.cs
- ProfileGroupSettingsCollection.cs
- SqlCommandBuilder.cs
- NotificationContext.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- CharUnicodeInfo.cs
- HostingEnvironment.cs
- querybuilder.cs
- DataControlPagerLinkButton.cs
- AttributeParameterInfo.cs
- HScrollProperties.cs
- DocumentViewerConstants.cs
- OrderByQueryOptionExpression.cs
- WebPartMenu.cs
- TransactionFlowAttribute.cs
- UnsafeNativeMethodsMilCoreApi.cs
- DataGrid.cs
- SqlConnectionStringBuilder.cs
- MailDefinition.cs
- TextSelection.cs
- CommandBindingCollection.cs
- AssociationSetMetadata.cs
- DbDataReader.cs
- CodeNamespace.cs
- Int32.cs
- NativeMethods.cs
- ObjectCloneHelper.cs
- XmlLoader.cs
- DataTableTypeConverter.cs
- WindowsRegion.cs
- X509Certificate.cs
- CreateUserWizard.cs
- ContentTypeSettingClientMessageFormatter.cs
- fixedPageContentExtractor.cs
- TimeSpanValidator.cs
- XmlValidatingReader.cs
- PropertyGridCommands.cs
- PersonalizationState.cs
- KeyInterop.cs
- SignatureResourcePool.cs
- FormatterServices.cs
- Point3DAnimation.cs
- WebPartEventArgs.cs
- exports.cs
- ConfigXmlCDataSection.cs
- ExpressionHelper.cs
- NativeMethods.cs
- Thickness.cs
- CustomErrorCollection.cs
- SafeFileMappingHandle.cs
- PermissionToken.cs
- WindowHideOrCloseTracker.cs
- BufferedGraphics.cs
- TableLayout.cs
- TableCell.cs
- WebReferenceOptions.cs
- BufferedReadStream.cs
- TreeNodeStyle.cs
- ArgIterator.cs
- X509CertificateInitiatorServiceCredential.cs
- TTSEngineProxy.cs
- DocumentApplication.cs
- CollectionViewGroupInternal.cs
- TwoPhaseCommit.cs
- PersonalizationDictionary.cs
- HostingEnvironmentSection.cs
- EmptyEnumerator.cs
- FocusTracker.cs