Code:
/ DotNET / DotNET / 8.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
- GrammarBuilderRuleRef.cs
- ACL.cs
- DifferencingCollection.cs
- CacheSection.cs
- SoapAttributeOverrides.cs
- ISCIIEncoding.cs
- TextTreeText.cs
- DataGridViewColumnConverter.cs
- DBBindings.cs
- HijriCalendar.cs
- SqlPersonalizationProvider.cs
- ApplicationDirectoryMembershipCondition.cs
- WebPartEventArgs.cs
- HotSpot.cs
- ToolStripDropDownItem.cs
- LabelLiteral.cs
- ProvideValueServiceProvider.cs
- DesignBindingConverter.cs
- PublishLicense.cs
- Parser.cs
- EdmType.cs
- FormViewPagerRow.cs
- CodeCompiler.cs
- MatchingStyle.cs
- MapPathBasedVirtualPathProvider.cs
- DataGridViewAdvancedBorderStyle.cs
- XmlWrappingReader.cs
- FormsAuthenticationModule.cs
- SqlStream.cs
- MailHeaderInfo.cs
- DataGridViewImageColumn.cs
- SspiWrapper.cs
- TrackBar.cs
- DecimalAnimationUsingKeyFrames.cs
- StreamFormatter.cs
- DataGridViewLayoutData.cs
- HandleExceptionArgs.cs
- BaseCollection.cs
- DataGridViewCellValueEventArgs.cs
- ExcludeFromCodeCoverageAttribute.cs
- BitSet.cs
- DataSysAttribute.cs
- VirtualPathData.cs
- Point.cs
- CompensateDesigner.cs
- PackageRelationship.cs
- HtmlInputText.cs
- HashHelpers.cs
- XmlRawWriter.cs
- TriggerActionCollection.cs
- dbenumerator.cs
- FixedSOMPageElement.cs
- KoreanLunisolarCalendar.cs
- DrawToolTipEventArgs.cs
- PrimitiveDataContract.cs
- Help.cs
- ImageMapEventArgs.cs
- DataGridCommandEventArgs.cs
- Attributes.cs
- WeakEventManager.cs
- HttpModuleActionCollection.cs
- TaskFileService.cs
- ProtectedConfigurationProviderCollection.cs
- SqlUnionizer.cs
- IPEndPointCollection.cs
- SerializationHelper.cs
- UnsafeMethods.cs
- TemplateXamlTreeBuilder.cs
- OverflowException.cs
- XmlNodeChangedEventArgs.cs
- NumericUpDownAccelerationCollection.cs
- DataGridViewRowPostPaintEventArgs.cs
- XmlHierarchicalDataSourceView.cs
- SettingsPropertyValueCollection.cs
- _IPv6Address.cs
- BinaryObjectInfo.cs
- PersonalizableAttribute.cs
- ConnectionManagementSection.cs
- HttpProtocolReflector.cs
- TextComposition.cs
- Tuple.cs
- FormatConvertedBitmap.cs
- XmlValidatingReaderImpl.cs
- DataGridComponentEditor.cs
- PingReply.cs
- RelatedPropertyManager.cs
- ProvideValueServiceProvider.cs
- UnsafeNativeMethods.cs
- DrawToolTipEventArgs.cs
- FileSystemWatcher.cs
- DbParameterHelper.cs
- FrameworkElementFactory.cs
- Normalizer.cs
- DrawListViewSubItemEventArgs.cs
- GridEntryCollection.cs
- CellNormalizer.cs
- FileLogRecordStream.cs
- MsmqHostedTransportConfiguration.cs
- ChannelSinkStacks.cs
- ConfigurationLockCollection.cs