Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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 // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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
- EntityDataSourceSelectedEventArgs.cs
- QueryCacheKey.cs
- PageParserFilter.cs
- LocalBuilder.cs
- StringStorage.cs
- SelectionEditingBehavior.cs
- ToolStripSplitButton.cs
- StaticFileHandler.cs
- WorkflowFileItem.cs
- RuntimeEnvironment.cs
- ServiceErrorHandler.cs
- CompiledQuery.cs
- FullTextLine.cs
- XmlNode.cs
- WindowsRegion.cs
- SendMailErrorEventArgs.cs
- DataObjectSettingDataEventArgs.cs
- TreeViewImageIndexConverter.cs
- ProfileBuildProvider.cs
- SmiEventSink_Default.cs
- StaticExtensionConverter.cs
- SecurityException.cs
- Int32CAMarshaler.cs
- ZeroOpNode.cs
- XPathNodeList.cs
- LoadItemsEventArgs.cs
- SystemIPv4InterfaceProperties.cs
- DataSourceCache.cs
- FormatSettings.cs
- ControlParameter.cs
- MimeReturn.cs
- HwndMouseInputProvider.cs
- PersonalizablePropertyEntry.cs
- MemberJoinTreeNode.cs
- ConfigurationPropertyAttribute.cs
- PageCatalogPart.cs
- WorkflowRuntimeServiceElement.cs
- TextServicesCompartmentEventSink.cs
- SqlBinder.cs
- ParseChildrenAsPropertiesAttribute.cs
- FileIOPermission.cs
- SchemaImporterExtensionsSection.cs
- BrowserInteropHelper.cs
- ETagAttribute.cs
- BindingSource.cs
- EdmComplexPropertyAttribute.cs
- QueryInterceptorAttribute.cs
- UIAgentMonitorHandle.cs
- VideoDrawing.cs
- followingsibling.cs
- FixedSOMPageConstructor.cs
- StrokeFIndices.cs
- DurationConverter.cs
- HttpCapabilitiesEvaluator.cs
- X509ImageLogo.cs
- RuntimeUtils.cs
- CheckableControlBaseAdapter.cs
- Partitioner.cs
- EFDataModelProvider.cs
- EventSourceCreationData.cs
- ObjectDataSourceFilteringEventArgs.cs
- TextOutput.cs
- propertyentry.cs
- TypeInformation.cs
- PriorityChain.cs
- DecoderExceptionFallback.cs
- PointCollection.cs
- NetworkInformationException.cs
- InsufficientMemoryException.cs
- StandardTransformFactory.cs
- SqlRewriteScalarSubqueries.cs
- UnmanagedMemoryAccessor.cs
- CounterSample.cs
- TextPointerBase.cs
- LinkTarget.cs
- SkinBuilder.cs
- DoubleAnimationBase.cs
- ISAPIApplicationHost.cs
- DataConnectionHelper.cs
- WinEventWrap.cs
- CleanUpVirtualizedItemEventArgs.cs
- SqlFlattener.cs
- DBDataPermissionAttribute.cs
- ScrollEventArgs.cs
- EventMappingSettingsCollection.cs
- SchemaNamespaceManager.cs
- WebPartCloseVerb.cs
- DoubleAnimation.cs
- WebPartDeleteVerb.cs
- OleDbPropertySetGuid.cs
- MailWebEventProvider.cs
- PersonalizationEntry.cs
- UrlRoutingHandler.cs
- FontFamilyIdentifier.cs
- UdpUtility.cs
- HTMLTextWriter.cs
- _UncName.cs
- HtmlMeta.cs
- UnknownBitmapDecoder.cs
- DetailsViewInsertEventArgs.cs