Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- odbcmetadatafactory.cs
- XmlQueryStaticData.cs
- Convert.cs
- OleDbCommandBuilder.cs
- ChooseAction.cs
- SqlEnums.cs
- XmlSchemaAny.cs
- SignerInfo.cs
- ConnectionPoolManager.cs
- MediaElementAutomationPeer.cs
- ConfigurationStrings.cs
- APCustomTypeDescriptor.cs
- StylusTouchDevice.cs
- SplashScreen.cs
- DataGridViewMethods.cs
- AuthenticationModuleElement.cs
- EntryWrittenEventArgs.cs
- backend.cs
- ListItemConverter.cs
- ExpressionNode.cs
- RecognizerInfo.cs
- PageThemeBuildProvider.cs
- BindingContext.cs
- regiisutil.cs
- RenamedEventArgs.cs
- PersistenceProviderFactory.cs
- PolicyManager.cs
- DataGridSortCommandEventArgs.cs
- WindowsListView.cs
- SmiEventStream.cs
- HtmlProps.cs
- Propagator.ExtentPlaceholderCreator.cs
- GenericWebPart.cs
- BaseTemplateCodeDomTreeGenerator.cs
- EntityUtil.cs
- ParseNumbers.cs
- XmlSchemaAnnotation.cs
- InheritanceContextChangedEventManager.cs
- SrgsRule.cs
- WizardStepBase.cs
- GridViewSortEventArgs.cs
- TextParentUndoUnit.cs
- XmlSchemaObjectTable.cs
- FontDialog.cs
- PersonalizationDictionary.cs
- RegisteredScript.cs
- StreamWithDictionary.cs
- FunctionCommandText.cs
- SrgsRule.cs
- PointCollectionValueSerializer.cs
- CustomErrorsSectionWrapper.cs
- LogAppendAsyncResult.cs
- GZipStream.cs
- Evidence.cs
- ObjectDataSourceFilteringEventArgs.cs
- SafeCryptoHandles.cs
- TcpChannelListener.cs
- OneOfScalarConst.cs
- ImageSourceValueSerializer.cs
- SqlDataRecord.cs
- DivideByZeroException.cs
- UriSection.cs
- EventWaitHandle.cs
- Sequence.cs
- MultiPropertyDescriptorGridEntry.cs
- Bitmap.cs
- RecordsAffectedEventArgs.cs
- ExtendedProperty.cs
- XmlAttribute.cs
- X509WindowsSecurityToken.cs
- FormsAuthenticationConfiguration.cs
- metadatamappinghashervisitor.cs
- CodeCompileUnit.cs
- ToolStripSettings.cs
- DataBoundControl.cs
- LinkLabelLinkClickedEvent.cs
- EdmScalarPropertyAttribute.cs
- SubMenuStyle.cs
- CompilerGlobalScopeAttribute.cs
- ClockController.cs
- ControlAdapter.cs
- CallbackValidator.cs
- PageStatePersister.cs
- CryptoHelper.cs
- BStrWrapper.cs
- TreeViewHitTestInfo.cs
- HttpListenerResponse.cs
- SymDocumentType.cs
- VirtualizingPanel.cs
- DecoratedNameAttribute.cs
- TableCell.cs
- DispatcherTimer.cs
- BuildManagerHost.cs
- EntityReference.cs
- Configuration.cs
- HostingMessageProperty.cs
- NavigatorInput.cs
- CodeDOMProvider.cs
- PersonalizationState.cs
- BamlLocalizer.cs