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
- NeutralResourcesLanguageAttribute.cs
- AuthenticationModulesSection.cs
- NullableIntAverageAggregationOperator.cs
- SafeCoTaskMem.cs
- ClientType.cs
- XmlSchemaSequence.cs
- CompleteWizardStep.cs
- MenuItemStyle.cs
- MessageDescriptionCollection.cs
- DesignerActionUIService.cs
- ParameterCollectionEditorForm.cs
- SortFieldComparer.cs
- OperationParameterInfoCollection.cs
- List.cs
- Model3DGroup.cs
- CompositeActivityTypeDescriptor.cs
- CTreeGenerator.cs
- DrawListViewItemEventArgs.cs
- DataControlFieldsEditor.cs
- RoutedCommand.cs
- TransformedBitmap.cs
- FixedDocumentSequencePaginator.cs
- ZoneLinkButton.cs
- ToolStripItemDataObject.cs
- MsmqIntegrationMessageProperty.cs
- CSharpCodeProvider.cs
- XmlSchemaSubstitutionGroup.cs
- ContextMenu.cs
- WebBrowserDocumentCompletedEventHandler.cs
- CompilationPass2TaskInternal.cs
- ProjectionPruner.cs
- ProfileProvider.cs
- DynamicObject.cs
- HttpContext.cs
- KeyConverter.cs
- httpapplicationstate.cs
- AccessDataSource.cs
- TrackPointCollection.cs
- _UncName.cs
- ChildrenQuery.cs
- Point3DCollectionConverter.cs
- ObjectDataSourceFilteringEventArgs.cs
- StrongNameIdentityPermission.cs
- BoolExpressionVisitors.cs
- ReflectEventDescriptor.cs
- Soap12ServerProtocol.cs
- ConfigurationStrings.cs
- DateTimeFormatInfoScanner.cs
- RangeValidator.cs
- Configuration.cs
- ObjectDataSource.cs
- XComponentModel.cs
- MetadataItemSerializer.cs
- ScriptComponentDescriptor.cs
- SelectionEditor.cs
- DataGridHeaderBorder.cs
- FirstQueryOperator.cs
- GradientStop.cs
- RetrieveVirtualItemEventArgs.cs
- CodeSnippetTypeMember.cs
- BamlBinaryWriter.cs
- AnnouncementEventArgs.cs
- ObjectIDGenerator.cs
- PropertyGrid.cs
- DefaultTextStoreTextComposition.cs
- odbcmetadatafactory.cs
- MemoryRecordBuffer.cs
- OleAutBinder.cs
- XsltCompileContext.cs
- WorkflowViewStateService.cs
- ISFTagAndGuidCache.cs
- WebConfigurationHostFileChange.cs
- WebControlAdapter.cs
- DisableDpiAwarenessAttribute.cs
- ArcSegment.cs
- CommonDialog.cs
- UserControl.cs
- TcpStreams.cs
- XmlWrappingReader.cs
- DocComment.cs
- ThrowHelper.cs
- GetIndexBinder.cs
- CodeMethodInvokeExpression.cs
- TextEditorTyping.cs
- PermissionToken.cs
- DataBoundControlHelper.cs
- DefaultValueTypeConverter.cs
- MenuItem.cs
- DistinctQueryOperator.cs
- PageRequestManager.cs
- EraserBehavior.cs
- DescendentsWalker.cs
- SessionPageStatePersister.cs
- TargetException.cs
- SqlRewriteScalarSubqueries.cs
- OdbcConnectionFactory.cs
- COM2EnumConverter.cs
- AssemblyUtil.cs
- CompilationRelaxations.cs
- PrimitiveSchema.cs