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
- CommandField.cs
- AngleUtil.cs
- OperationCanceledException.cs
- NativeRightsManagementAPIsStructures.cs
- AssemblyAttributesGoHere.cs
- ParallelRangeManager.cs
- XmlSchemaComplexType.cs
- DiscoveryClientElement.cs
- WebPartZoneCollection.cs
- Conditional.cs
- XsltLoader.cs
- NotSupportedException.cs
- NativeMethods.cs
- BCryptNative.cs
- ProgressPage.cs
- ProviderSettings.cs
- ByteAnimationBase.cs
- CreateUserWizard.cs
- ListCollectionView.cs
- Grant.cs
- CompilerParameters.cs
- FocusChangedEventArgs.cs
- RayMeshGeometry3DHitTestResult.cs
- SqlTypesSchemaImporter.cs
- NotifyParentPropertyAttribute.cs
- PropertyGridEditorPart.cs
- ClientApiGenerator.cs
- XmlRawWriterWrapper.cs
- XsltException.cs
- PDBReader.cs
- RTLAwareMessageBox.cs
- ExclusiveNamedPipeTransportManager.cs
- ImageBrush.cs
- XmlSchemaImport.cs
- DbUpdateCommandTree.cs
- NullableFloatAverageAggregationOperator.cs
- MessageTraceRecord.cs
- DesignOnlyAttribute.cs
- XamlTreeBuilderBamlRecordWriter.cs
- CallbackException.cs
- Matrix.cs
- UIAgentCrashedException.cs
- ButtonPopupAdapter.cs
- SchemaHelper.cs
- TextSpan.cs
- AliasedSlot.cs
- SystemWebCachingSectionGroup.cs
- EnlistmentState.cs
- PartitionedDataSource.cs
- EnlistmentState.cs
- RegistryPermission.cs
- GeneralTransform3D.cs
- ResourceSetExpression.cs
- AndCondition.cs
- KeyedQueue.cs
- GenerateScriptTypeAttribute.cs
- WebBaseEventKeyComparer.cs
- GridLength.cs
- Identity.cs
- RowUpdatingEventArgs.cs
- _BasicClient.cs
- WebPartDisplayModeCancelEventArgs.cs
- ValueSerializer.cs
- SmtpTransport.cs
- RemotingServices.cs
- HelpInfo.cs
- ETagAttribute.cs
- Error.cs
- CapabilitiesSection.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- DelegateSerializationHolder.cs
- RadioButtonFlatAdapter.cs
- Zone.cs
- AssemblyHelper.cs
- TagMapInfo.cs
- PKCS1MaskGenerationMethod.cs
- Parallel.cs
- ClockController.cs
- PrintDialog.cs
- TemplateField.cs
- x509store.cs
- ContextQuery.cs
- CheckBoxFlatAdapter.cs
- SharedHttpsTransportManager.cs
- IncrementalHitTester.cs
- XmlImplementation.cs
- ToolBarButton.cs
- ToolStripItemCollection.cs
- X509Certificate2.cs
- IdentifierCollection.cs
- LeafCellTreeNode.cs
- UseLicense.cs
- fixedPageContentExtractor.cs
- CFStream.cs
- SudsParser.cs
- ColumnBinding.cs
- ipaddressinformationcollection.cs
- ObjectCacheHost.cs
- CipherData.cs
- PasswordRecoveryDesigner.cs