Code:
/ FX-1434 / FX-1434 / 1.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
- AnnotationComponentChooser.cs
- Mapping.cs
- XmlReaderSettings.cs
- TextPattern.cs
- WebServiceBindingAttribute.cs
- DesignTimeVisibleAttribute.cs
- BitmapSizeOptions.cs
- Rules.cs
- ExceptionHandlers.cs
- ListView.cs
- FloaterParagraph.cs
- DataGridHyperlinkColumn.cs
- DataGridViewCellConverter.cs
- AnyAllSearchOperator.cs
- RIPEMD160Managed.cs
- PolicyException.cs
- SoapReflectionImporter.cs
- Vector3DAnimationUsingKeyFrames.cs
- RowUpdatingEventArgs.cs
- TypeSystemHelpers.cs
- NamespaceEmitter.cs
- ResourceDescriptionAttribute.cs
- SortDescription.cs
- OuterGlowBitmapEffect.cs
- HashAlgorithm.cs
- ResourceManager.cs
- SamlSubject.cs
- AudioException.cs
- LinkClickEvent.cs
- FastEncoder.cs
- FrameworkElement.cs
- TextProperties.cs
- MiniCustomAttributeInfo.cs
- SrgsElementFactoryCompiler.cs
- LoadWorkflowAsyncResult.cs
- DbTypeMap.cs
- CheckBox.cs
- CookieParameter.cs
- StrongTypingException.cs
- Semaphore.cs
- AffineTransform3D.cs
- ConstNode.cs
- ExceptionRoutedEventArgs.cs
- InputLanguageProfileNotifySink.cs
- _NegotiateClient.cs
- ReliableMessagingVersion.cs
- KeyboardNavigation.cs
- parserscommon.cs
- COM2FontConverter.cs
- sqlstateclientmanager.cs
- GlobalItem.cs
- ScrollBar.cs
- AssociationSetEnd.cs
- FixedBufferAttribute.cs
- WindowsFormsSynchronizationContext.cs
- ThreadExceptionDialog.cs
- BrowserDefinition.cs
- FrameworkContentElement.cs
- EdmMember.cs
- BindingSource.cs
- PolyLineSegment.cs
- SkipQueryOptionExpression.cs
- BindingNavigator.cs
- StdValidatorsAndConverters.cs
- MutexSecurity.cs
- SessionEndedEventArgs.cs
- BinaryUtilClasses.cs
- HttpProtocolImporter.cs
- QueueException.cs
- LayoutUtils.cs
- RelationshipSet.cs
- SafeRightsManagementPubHandle.cs
- IsolatedStorage.cs
- IEnumerable.cs
- SignatureHelper.cs
- TransportSecurityBindingElement.cs
- ObjectMemberMapping.cs
- InteropEnvironment.cs
- PropertyHelper.cs
- ModelTreeEnumerator.cs
- PropertyPath.cs
- HttpCacheParams.cs
- DrawingVisual.cs
- ImageMapEventArgs.cs
- oledbmetadatacolumnnames.cs
- InfoCardTrace.cs
- SignatureHelper.cs
- wmiutil.cs
- Item.cs
- EncryptedPackageFilter.cs
- SqlAliasesReferenced.cs
- SafeViewOfFileHandle.cs
- XsdBuildProvider.cs
- InputManager.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- ClientConfigurationSystem.cs
- SoapHttpTransportImporter.cs
- ValidationService.cs
- PrimaryKeyTypeConverter.cs
- RadioButton.cs