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
- GPRECT.cs
- DataServiceHostFactory.cs
- HwndSubclass.cs
- PersonalizationDictionary.cs
- DecryptRequest.cs
- ConditionalAttribute.cs
- ObjectKeyFrameCollection.cs
- IisTraceListener.cs
- PriorityQueue.cs
- SamlAuthenticationStatement.cs
- MachineKeyValidationConverter.cs
- FilterableAttribute.cs
- UniqueConstraint.cs
- PolyLineSegment.cs
- SqlParameterCollection.cs
- HTTP_SERVICE_CONFIG_URLACL_KEY.cs
- NeutralResourcesLanguageAttribute.cs
- BatchParser.cs
- MenuCommands.cs
- NativeActivity.cs
- TableLayoutStyle.cs
- StringBlob.cs
- LinkLabel.cs
- PenContexts.cs
- PictureBox.cs
- SecurityMode.cs
- GcSettings.cs
- InternalConfigEventArgs.cs
- AssemblyResourceLoader.cs
- CodeTypeDeclarationCollection.cs
- DoubleCollectionValueSerializer.cs
- InstanceLockException.cs
- DelegateSerializationHolder.cs
- InstanceDataCollectionCollection.cs
- EntityContainerEntitySet.cs
- DesignerTransaction.cs
- DataTableTypeConverter.cs
- SafeRightsManagementPubHandle.cs
- UnsafeNativeMethods.cs
- ReflectEventDescriptor.cs
- SiteMapHierarchicalDataSourceView.cs
- MessageQuerySet.cs
- OrderByLifter.cs
- CompiledQueryCacheEntry.cs
- AdvancedBindingPropertyDescriptor.cs
- Brush.cs
- ToolStripContentPanel.cs
- BulletDecorator.cs
- HyperLink.cs
- GroupPartitionExpr.cs
- Literal.cs
- ScrollPattern.cs
- EntityParameterCollection.cs
- Matrix3D.cs
- CustomAttribute.cs
- InvalidChannelBindingException.cs
- JoinQueryOperator.cs
- StateBag.cs
- MailDefinition.cs
- VScrollProperties.cs
- Rfc2898DeriveBytes.cs
- PackageRelationshipSelector.cs
- ResourcesBuildProvider.cs
- WebPartUserCapability.cs
- precedingsibling.cs
- DataGridViewComboBoxCell.cs
- FileDialogCustomPlacesCollection.cs
- DispatchChannelSink.cs
- SqlCacheDependencyDatabase.cs
- ConfigurationElementCollection.cs
- DataPagerFieldCommandEventArgs.cs
- IndexedString.cs
- RadioButtonAutomationPeer.cs
- WorkflowFormatterBehavior.cs
- TextPattern.cs
- EntryPointNotFoundException.cs
- RectAnimationClockResource.cs
- TrackingMemoryStream.cs
- ChtmlTextWriter.cs
- DeleteHelper.cs
- SingleTagSectionHandler.cs
- CustomBindingElement.cs
- CodeTypeReferenceCollection.cs
- Item.cs
- StyleXamlParser.cs
- LocalValueEnumerator.cs
- _TransmitFileOverlappedAsyncResult.cs
- DbInsertCommandTree.cs
- UnsafeNativeMethods.cs
- SwitchCase.cs
- ColorTransformHelper.cs
- TextServicesLoader.cs
- AspCompat.cs
- ApplicationManager.cs
- TemplateParser.cs
- FixUp.cs
- HttpContextWrapper.cs
- TypeDelegator.cs
- Int64Storage.cs
- RequestCachePolicyConverter.cs