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
- TransformerInfo.cs
- FrameworkReadOnlyPropertyMetadata.cs
- DESCryptoServiceProvider.cs
- CookielessData.cs
- StorageModelBuildProvider.cs
- TickBar.cs
- TypeHelper.cs
- PreparingEnlistment.cs
- TemplatedEditableDesignerRegion.cs
- UnsafeNativeMethods.cs
- SessionStateUtil.cs
- CodeCatchClauseCollection.cs
- BitmapEffectRenderDataResource.cs
- Convert.cs
- RepeaterItemEventArgs.cs
- AtomServiceDocumentSerializer.cs
- ReferentialConstraint.cs
- XomlSerializationHelpers.cs
- ParseHttpDate.cs
- StringKeyFrameCollection.cs
- Calendar.cs
- metadatamappinghashervisitor.cs
- httpserverutility.cs
- Int32AnimationUsingKeyFrames.cs
- PackageRelationshipCollection.cs
- RectAnimationUsingKeyFrames.cs
- ContextMarshalException.cs
- DataSetViewSchema.cs
- TransformPattern.cs
- FilterRepeater.cs
- MetafileEditor.cs
- SecurityPermission.cs
- XPathDocumentNavigator.cs
- ListItemCollection.cs
- Package.cs
- RefreshEventArgs.cs
- UIElementCollection.cs
- BamlRecordReader.cs
- DeferredRunTextReference.cs
- _ScatterGatherBuffers.cs
- XPathExpr.cs
- WindowsListViewGroup.cs
- GlobalizationAssembly.cs
- HashCodeCombiner.cs
- WebDescriptionAttribute.cs
- FileChangesMonitor.cs
- IntPtr.cs
- ProxySimple.cs
- ItemCheckEvent.cs
- CompositeFontFamily.cs
- ArrayWithOffset.cs
- RuleSettingsCollection.cs
- Helpers.cs
- CodeMemberProperty.cs
- DataConnectionHelper.cs
- MergablePropertyAttribute.cs
- recordstate.cs
- SystemWebExtensionsSectionGroup.cs
- EncoderBestFitFallback.cs
- NeedSkipTokenVisitor.cs
- KeyGesture.cs
- DESCryptoServiceProvider.cs
- ParseChildrenAsPropertiesAttribute.cs
- WebServiceData.cs
- Clipboard.cs
- PropertyBuilder.cs
- FocusWithinProperty.cs
- SplineKeyFrames.cs
- MenuCommand.cs
- TopClause.cs
- RegexCaptureCollection.cs
- DataTable.cs
- DiagnosticTraceSource.cs
- TraceSection.cs
- RoutingUtilities.cs
- PrivilegeNotHeldException.cs
- DesignTimeValidationFeature.cs
- RemoteWebConfigurationHost.cs
- XmlValidatingReader.cs
- ImageSourceValueSerializer.cs
- _NestedMultipleAsyncResult.cs
- SqlUnionizer.cs
- InvalidFilterCriteriaException.cs
- ThreadSafeList.cs
- EmptyEnumerable.cs
- DataRowView.cs
- DataGridViewButtonColumn.cs
- WindowsAltTab.cs
- InlineObject.cs
- ByteStreamMessageEncodingElement.cs
- SqlDataSourceEnumerator.cs
- AppPool.cs
- DeploymentExceptionMapper.cs
- DrawingContext.cs
- BufferedGraphicsManager.cs
- TextProperties.cs
- AsymmetricSignatureDeformatter.cs
- SafeHandles.cs
- XmlSchemaGroup.cs
- TagPrefixInfo.cs