Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UriWriter.cs
- AmbientEnvironment.cs
- KerberosReceiverSecurityToken.cs
- UIElement.cs
- GridErrorDlg.cs
- CodeEventReferenceExpression.cs
- SharedRuntimeState.cs
- PrintPageEvent.cs
- TypedDatasetGenerator.cs
- ScriptControlDescriptor.cs
- DesignerForm.cs
- ClassicBorderDecorator.cs
- TemplateBuilder.cs
- VBCodeProvider.cs
- OperationParameterInfoCollection.cs
- CheckBoxBaseAdapter.cs
- TypeToStringValueConverter.cs
- Rotation3DKeyFrameCollection.cs
- XmlAnyElementAttributes.cs
- PerformanceCounterPermission.cs
- DataFormats.cs
- HttpListener.cs
- IPAddressCollection.cs
- WpfWebRequestHelper.cs
- PartEditor.cs
- AutomationPatternInfo.cs
- ObfuscateAssemblyAttribute.cs
- Win32Exception.cs
- TextTreeRootTextBlock.cs
- SubtreeProcessor.cs
- MetadataUtil.cs
- StsCommunicationException.cs
- ToolStripItemGlyph.cs
- SubstitutionList.cs
- EventLogEntryCollection.cs
- SimplePropertyEntry.cs
- HtmlInputButton.cs
- SqlDataSourceConnectionPanel.cs
- WindowsListViewGroupSubsetLink.cs
- FlowStep.cs
- TypeSource.cs
- Properties.cs
- SchemaTableColumn.cs
- ChangePassword.cs
- ErrorWrapper.cs
- InvariantComparer.cs
- QilTargetType.cs
- XmlDataDocument.cs
- EmbeddedObject.cs
- RangeBase.cs
- WebBrowserUriTypeConverter.cs
- GridViewRow.cs
- DataGridViewRowConverter.cs
- DesignerProperties.cs
- SqlPersonalizationProvider.cs
- ValidationErrorCollection.cs
- GeneratedContractType.cs
- ManipulationInertiaStartingEventArgs.cs
- XmlFormatWriterGenerator.cs
- ChangeNode.cs
- SeekStoryboard.cs
- ContextStack.cs
- PublisherIdentityPermission.cs
- LayoutExceptionEventArgs.cs
- JsonUriDataContract.cs
- IpcManager.cs
- querybuilder.cs
- XmlSchemaAttributeGroupRef.cs
- NativeWindow.cs
- ListViewTableCell.cs
- ApplicationSecurityManager.cs
- CodeCatchClause.cs
- XmlDataDocument.cs
- MarkupExtensionReturnTypeAttribute.cs
- EdmTypeAttribute.cs
- OverflowException.cs
- EntityConnectionStringBuilder.cs
- DataGridViewColumnCollection.cs
- EventProviderTraceListener.cs
- AddValidationError.cs
- CodeTypeDeclaration.cs
- DiagnosticTrace.cs
- WebDescriptionAttribute.cs
- ImportCatalogPart.cs
- StylusPlugInCollection.cs
- DataRecordObjectView.cs
- ButtonAutomationPeer.cs
- EntitySqlQueryCacheKey.cs
- ListViewTableRow.cs
- DataBoundControl.cs
- ContactManager.cs
- BinaryFormatter.cs
- TemplatedMailWebEventProvider.cs
- DataRowChangeEvent.cs
- MouseWheelEventArgs.cs
- ImageMapEventArgs.cs
- ValidationSummary.cs
- HtmlInputControl.cs
- CodeMemberEvent.cs
- CodeDOMUtility.cs