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
- ThreadExceptionEvent.cs
- SecurityTokenValidationException.cs
- SessionParameter.cs
- HitTestParameters.cs
- CodeMethodReturnStatement.cs
- DataTableNameHandler.cs
- StringOutput.cs
- EntityClassGenerator.cs
- MessageAction.cs
- FloatMinMaxAggregationOperator.cs
- PreservationFileReader.cs
- DependencyObjectType.cs
- TraceData.cs
- LocalizabilityAttribute.cs
- VisualBasicValue.cs
- GridItemCollection.cs
- SQLGuid.cs
- PreviewKeyDownEventArgs.cs
- Triangle.cs
- MatchAllMessageFilter.cs
- DataGridViewMethods.cs
- SecurityResources.cs
- IndexedWhereQueryOperator.cs
- UDPClient.cs
- OptimisticConcurrencyException.cs
- Number.cs
- EncryptedReference.cs
- ValidationRuleCollection.cs
- Rotation3DAnimation.cs
- ConnectionManagementElement.cs
- PeerEndPoint.cs
- Rotation3DAnimation.cs
- SchemaElementDecl.cs
- Matrix3DConverter.cs
- ObjectDataSourceDesigner.cs
- WorkflowNamespace.cs
- GenerateTemporaryTargetAssembly.cs
- DynamicILGenerator.cs
- ScriptingRoleServiceSection.cs
- ScriptHandlerFactory.cs
- DropDownList.cs
- TextFormatterHost.cs
- RefreshEventArgs.cs
- ServiceRoute.cs
- Clipboard.cs
- SqlHelper.cs
- MarkupExtensionSerializer.cs
- Number.cs
- RequestUriProcessor.cs
- SpellerInterop.cs
- ManualResetEvent.cs
- CompensateDesigner.cs
- DefaultObjectMappingItemCollection.cs
- ListBoxAutomationPeer.cs
- DataRowChangeEvent.cs
- X509CertificateTokenFactoryCredential.cs
- FixedSOMLineCollection.cs
- DataControlImageButton.cs
- HandleRef.cs
- SystemKeyConverter.cs
- DrawingGroupDrawingContext.cs
- ThreadAttributes.cs
- GridProviderWrapper.cs
- WsrmTraceRecord.cs
- AccessedThroughPropertyAttribute.cs
- DataGridItem.cs
- VisualCollection.cs
- ProxyWebPartManager.cs
- HwndHostAutomationPeer.cs
- PageBuildProvider.cs
- PointAnimationBase.cs
- ExceptionUtility.cs
- ModelVisual3D.cs
- TabItemAutomationPeer.cs
- RootBrowserWindowAutomationPeer.cs
- PasswordRecoveryAutoFormat.cs
- AuthorizationRuleCollection.cs
- DesignerView.Commands.cs
- MenuItemBindingCollection.cs
- Menu.cs
- BehaviorEditorPart.cs
- OAVariantLib.cs
- SecurityAccessDeniedException.cs
- Convert.cs
- FrameworkElementFactoryMarkupObject.cs
- AutoResizedEvent.cs
- SqlInternalConnectionSmi.cs
- XslTransform.cs
- SQLDateTimeStorage.cs
- DbBuffer.cs
- SoapExtensionTypeElement.cs
- SharedDp.cs
- CompilerGlobalScopeAttribute.cs
- SmiConnection.cs
- ResourceExpressionBuilder.cs
- ZipIOExtraFieldZip64Element.cs
- SerialErrors.cs
- IInstanceTable.cs
- StylusCaptureWithinProperty.cs
- RegistrySecurity.cs