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
- DSACryptoServiceProvider.cs
- IdentityReference.cs
- ChangePasswordAutoFormat.cs
- IProvider.cs
- KeyPressEvent.cs
- DateTimeOffsetConverter.cs
- ProtectedConfiguration.cs
- BitmapEffectDrawing.cs
- TargetConverter.cs
- CrossAppDomainChannel.cs
- WriteFileContext.cs
- XmlAnyAttributeAttribute.cs
- GridView.cs
- IItemContainerGenerator.cs
- SchemaCollectionPreprocessor.cs
- DataColumnChangeEvent.cs
- StylusPointCollection.cs
- XmlLoader.cs
- XamlVector3DCollectionSerializer.cs
- WebPartMovingEventArgs.cs
- XPathNavigatorKeyComparer.cs
- RawAppCommandInputReport.cs
- DataControlCommands.cs
- HashAlgorithm.cs
- FileDialog_Vista.cs
- MatrixTransform3D.cs
- ResXBuildProvider.cs
- VectorAnimationBase.cs
- DocumentPageView.cs
- MaxMessageSizeStream.cs
- MatrixUtil.cs
- DataGridViewRowsAddedEventArgs.cs
- CodeArgumentReferenceExpression.cs
- ErrorStyle.cs
- InternalResources.cs
- MessageCredentialType.cs
- WebHttpSecurityModeHelper.cs
- PasswordTextContainer.cs
- FileReservationCollection.cs
- CFStream.cs
- PathTooLongException.cs
- HashHelper.cs
- oledbconnectionstring.cs
- XmlSerializerSection.cs
- BlurEffect.cs
- ListDictionaryInternal.cs
- XmlNamespaceDeclarationsAttribute.cs
- ConfigXmlText.cs
- Partitioner.cs
- PagerStyle.cs
- CodeDefaultValueExpression.cs
- TargetParameterCountException.cs
- XNodeValidator.cs
- HttpRuntime.cs
- AccessorTable.cs
- PagePropertiesChangingEventArgs.cs
- DateTimeUtil.cs
- Stream.cs
- QueryOutputWriter.cs
- LinkedResource.cs
- DataGridViewRowsRemovedEventArgs.cs
- BitmapEffectCollection.cs
- HttpsHostedTransportConfiguration.cs
- ParentQuery.cs
- CalculatedColumn.cs
- DataSpaceManager.cs
- ApplicationId.cs
- OleDbConnectionInternal.cs
- PerformanceCounterPermission.cs
- InternalConfigSettingsFactory.cs
- FacetEnabledSchemaElement.cs
- SplayTreeNode.cs
- DataFormats.cs
- WebPartMinimizeVerb.cs
- TemplateBindingExpressionConverter.cs
- DataControlFieldCollection.cs
- HwndAppCommandInputProvider.cs
- AuthenticationConfig.cs
- SafeEventLogWriteHandle.cs
- Logging.cs
- AutomationElement.cs
- SerializationSectionGroup.cs
- InternalsVisibleToAttribute.cs
- Setter.cs
- MULTI_QI.cs
- SQLString.cs
- RTLAwareMessageBox.cs
- SqlDataSourceEnumerator.cs
- ScalarType.cs
- StateMachineWorkflowDesigner.cs
- SafeEventLogReadHandle.cs
- UrlMappingCollection.cs
- HttpStreams.cs
- DesignerMetadata.cs
- DbSetClause.cs
- XmlBinaryReader.cs
- DataBoundControlHelper.cs
- SafeBitVector32.cs
- NamespaceQuery.cs
- TextMarkerSource.cs