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
- WizardPanel.cs
- TraceData.cs
- XmlSchemaValidator.cs
- XmlUtil.cs
- IteratorAsyncResult.cs
- ConcurrencyBehavior.cs
- Library.cs
- HtmlTextArea.cs
- SymDocumentType.cs
- ArgumentDesigner.xaml.cs
- GacUtil.cs
- LocalIdCollection.cs
- AdornerDecorator.cs
- XmlSchemaNotation.cs
- KeyProperty.cs
- AssemblyInfo.cs
- ThemeInfoAttribute.cs
- SystemPens.cs
- EmissiveMaterial.cs
- LabelAutomationPeer.cs
- HwndHost.cs
- DeviceContexts.cs
- WebMessageEncoderFactory.cs
- ToolStripMenuItem.cs
- JulianCalendar.cs
- PageVisual.cs
- StringSorter.cs
- ToolboxDataAttribute.cs
- FragmentQueryProcessor.cs
- TargetControlTypeCache.cs
- BrowserCapabilitiesCompiler.cs
- ComponentResourceManager.cs
- TrustSection.cs
- FixedPageAutomationPeer.cs
- MultiDataTrigger.cs
- HexParser.cs
- FilterEventArgs.cs
- CompoundFileStreamReference.cs
- ArraySet.cs
- TableRowCollection.cs
- SingleResultAttribute.cs
- BinaryObjectInfo.cs
- ChannelServices.cs
- ImageFormat.cs
- SecureConversationServiceCredential.cs
- WorkflowInstance.cs
- IFormattable.cs
- PeerApplication.cs
- PropertyEmitterBase.cs
- Rethrow.cs
- control.ime.cs
- CharAnimationUsingKeyFrames.cs
- DBConnectionString.cs
- ImageDrawing.cs
- OptimalTextSource.cs
- RayMeshGeometry3DHitTestResult.cs
- PtsCache.cs
- DefaultHttpHandler.cs
- Span.cs
- TextFormatterHost.cs
- DependencyPropertyChangedEventArgs.cs
- TemplateModeChangedEventArgs.cs
- StrokeRenderer.cs
- FileInfo.cs
- Inflater.cs
- AttributeData.cs
- ObjectHandle.cs
- Simplifier.cs
- BoundColumn.cs
- ProfileSettingsCollection.cs
- PermissionToken.cs
- IsolationInterop.cs
- DataBoundLiteralControl.cs
- TreeViewEvent.cs
- WebAdminConfigurationHelper.cs
- KeyValueConfigurationElement.cs
- Compilation.cs
- HebrewNumber.cs
- OleDbRowUpdatingEvent.cs
- AnnotationAdorner.cs
- ListBoxItem.cs
- GridViewColumnHeaderAutomationPeer.cs
- XmlTextAttribute.cs
- EnumerableRowCollectionExtensions.cs
- MultipleViewPattern.cs
- QueryStatement.cs
- DataBindingHandlerAttribute.cs
- updateconfighost.cs
- DataGridViewCellCollection.cs
- XmlSchemaSet.cs
- UserControl.cs
- DiagnosticTrace.cs
- ControlParameter.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- MatrixTransform3D.cs
- IOException.cs
- StreamResourceInfo.cs
- LowerCaseStringConverter.cs
- PenThreadWorker.cs
- MembershipPasswordException.cs