Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RuntimeCompatibilityAttribute.cs
- RadioButtonRenderer.cs
- Win32MouseDevice.cs
- CompositeKey.cs
- InfiniteIntConverter.cs
- GeneralTransform.cs
- RelationHandler.cs
- FilterQuery.cs
- XmlConverter.cs
- DSACryptoServiceProvider.cs
- Frame.cs
- ServiceDurableInstance.cs
- LineInfo.cs
- AttributeCollection.cs
- Decimal.cs
- CollectionChangedEventManager.cs
- LogSwitch.cs
- XmlChildNodes.cs
- ContainerSelectorBehavior.cs
- RealProxy.cs
- DiffuseMaterial.cs
- Pts.cs
- Int16Storage.cs
- AssemblyHelper.cs
- WriteableBitmap.cs
- SymbolMethod.cs
- PatternMatcher.cs
- Helpers.cs
- DataTableMapping.cs
- XmlSchemaType.cs
- BridgeDataRecord.cs
- GraphicsContext.cs
- Parser.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- SequenceDesigner.cs
- WebHostScriptMappingsInstallComponent.cs
- JsonByteArrayDataContract.cs
- ImageClickEventArgs.cs
- Queue.cs
- IxmlLineInfo.cs
- XmlAttributeOverrides.cs
- UnsafeNativeMethods.cs
- DrawingVisual.cs
- UnsafeNativeMethods.cs
- WebMessageFormatHelper.cs
- Rfc2898DeriveBytes.cs
- FontUnitConverter.cs
- RegexRunnerFactory.cs
- mediapermission.cs
- AppSettingsExpressionEditor.cs
- DomainUpDown.cs
- TextParaLineResult.cs
- XmlSchemaComplexContent.cs
- EventProviderTraceListener.cs
- DataStreamFromComStream.cs
- MetadataImporter.cs
- TextModifierScope.cs
- ReadOnlyCollectionBase.cs
- BufferModesCollection.cs
- XPathAncestorQuery.cs
- Command.cs
- ScriptMethodAttribute.cs
- ScrollProperties.cs
- DataGridColumnEventArgs.cs
- SessionEndedEventArgs.cs
- DeviceContext.cs
- HashRepartitionStream.cs
- FileDialog_Vista_Interop.cs
- CustomAttribute.cs
- JavascriptCallbackBehaviorAttribute.cs
- FirstMatchCodeGroup.cs
- DirectoryObjectSecurity.cs
- HwndProxyElementProvider.cs
- ClientUtils.cs
- AdCreatedEventArgs.cs
- CompressStream.cs
- PassportPrincipal.cs
- SoapElementAttribute.cs
- PrefixQName.cs
- COAUTHINFO.cs
- ActivationServices.cs
- CellConstant.cs
- MobileControlsSectionHelper.cs
- PeerApplication.cs
- TypeGeneratedEventArgs.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- DataViewManager.cs
- ProcessProtocolHandler.cs
- DaylightTime.cs
- ChannelCacheDefaults.cs
- Rectangle.cs
- ValueChangedEventManager.cs
- SendMailErrorEventArgs.cs
- WmiPutTraceRecord.cs
- InstanceContextMode.cs
- SmtpFailedRecipientException.cs
- BufferModeSettings.cs
- UICuesEvent.cs
- ActivityUtilities.cs
- SafeNativeMethods.cs