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
- CompiledQuery.cs
- UpdateInfo.cs
- DynamicVirtualDiscoSearcher.cs
- ResourceSetExpression.cs
- CommandSet.cs
- GroupBoxAutomationPeer.cs
- MarshalByValueComponent.cs
- RelationshipFixer.cs
- ColorBlend.cs
- WindowInteropHelper.cs
- coordinator.cs
- xamlnodes.cs
- SourceInterpreter.cs
- UInt32Storage.cs
- PackWebRequest.cs
- SqlDataReader.cs
- SpellCheck.cs
- ZipIOLocalFileDataDescriptor.cs
- GraphicsPathIterator.cs
- ErrorStyle.cs
- ComponentEvent.cs
- RegexNode.cs
- Composition.cs
- COM2PropertyBuilderUITypeEditor.cs
- Single.cs
- TaskDesigner.cs
- NavigatorInput.cs
- X509Logo.cs
- PropertyReference.cs
- HtmlDocument.cs
- QuotedStringWriteStateInfo.cs
- DBDataPermission.cs
- _SSPISessionCache.cs
- EventLogPropertySelector.cs
- _Connection.cs
- RightsDocument.cs
- SequentialUshortCollection.cs
- RadioButtonList.cs
- _Connection.cs
- SmtpClient.cs
- BatchStream.cs
- Queue.cs
- PrefixHandle.cs
- EdmType.cs
- XmlChildNodes.cs
- securestring.cs
- XmlSchemaImporter.cs
- XamlTemplateSerializer.cs
- TextStore.cs
- NodeCounter.cs
- TraceLog.cs
- CodeAccessPermission.cs
- Wrapper.cs
- OrderedDictionary.cs
- WorkflowClientDeliverMessageWrapper.cs
- BaseCodeDomTreeGenerator.cs
- TraceRecord.cs
- ListItemCollection.cs
- WebPartTracker.cs
- KerberosSecurityTokenAuthenticator.cs
- WebServiceResponse.cs
- StringExpressionSet.cs
- ClientData.cs
- RTLAwareMessageBox.cs
- CacheHelper.cs
- WindowsFormsLinkLabel.cs
- ImageCodecInfo.cs
- SafeNativeMethods.cs
- HtmlTextArea.cs
- MessageContractMemberAttribute.cs
- DesignerVerb.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- SiteMapNodeItemEventArgs.cs
- ThemeableAttribute.cs
- DocComment.cs
- TimeoutStream.cs
- MenuDesigner.cs
- MsmqIntegrationChannelFactory.cs
- CodeGenerator.cs
- JsonWriterDelegator.cs
- DataGridViewColumnTypeEditor.cs
- CorrelationActionMessageFilter.cs
- DeviceSpecificChoiceCollection.cs
- PenLineCapValidation.cs
- CatalogZoneAutoFormat.cs
- Screen.cs
- DataPagerField.cs
- PathStreamGeometryContext.cs
- Random.cs
- DeviceContext.cs
- DataGridHeaderBorder.cs
- AssemblyHash.cs
- CqlParserHelpers.cs
- ConnectionManagementElementCollection.cs
- FilterableAttribute.cs
- LockCookie.cs
- CheckBoxBaseAdapter.cs
- RootProjectionNode.cs
- MultiTrigger.cs
- TextBoxAutomationPeer.cs