Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / _BufferOffsetSize.cs / 1305376 / _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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebRequestModuleElement.cs
- MenuItem.cs
- EdmSchemaError.cs
- TreeViewItemAutomationPeer.cs
- SwitchAttribute.cs
- Imaging.cs
- OdbcEnvironment.cs
- MarshalByRefObject.cs
- FilterException.cs
- SQLUtility.cs
- HtmlHead.cs
- SQLInt32Storage.cs
- PermissionRequestEvidence.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- FixedSOMFixedBlock.cs
- ReflectEventDescriptor.cs
- JapaneseCalendar.cs
- SqlClientPermission.cs
- CorrelationManager.cs
- DeriveBytes.cs
- CookielessHelper.cs
- CatalogZoneBase.cs
- BitmapEffectInput.cs
- ByteConverter.cs
- ValidatorCompatibilityHelper.cs
- DesignerMetadata.cs
- ECDiffieHellmanCngPublicKey.cs
- entitydatasourceentitysetnameconverter.cs
- DataGridViewDataConnection.cs
- ImagingCache.cs
- CodeTypeParameterCollection.cs
- SamlSecurityToken.cs
- DeobfuscatingStream.cs
- ListControlConvertEventArgs.cs
- CharEnumerator.cs
- DownloadProgressEventArgs.cs
- PackageRelationshipSelector.cs
- UserControlBuildProvider.cs
- VersionValidator.cs
- PropertyGridDesigner.cs
- HostedAspNetEnvironment.cs
- ObjectStateManager.cs
- TreeWalkHelper.cs
- XsltSettings.cs
- SchemaDeclBase.cs
- PropertyConverter.cs
- FullTrustAssemblyCollection.cs
- AppSettingsExpressionBuilder.cs
- PersistenceMetadataNamespace.cs
- SafeEventLogWriteHandle.cs
- GZipStream.cs
- PageEventArgs.cs
- Parameter.cs
- XmlWriterSettings.cs
- ScrollProviderWrapper.cs
- TreeNode.cs
- WindowsScrollBarBits.cs
- AmbientLight.cs
- PTProvider.cs
- SamlSecurityTokenAuthenticator.cs
- AgileSafeNativeMemoryHandle.cs
- UnitySerializationHolder.cs
- ContextMenuStrip.cs
- XmlSchemaIdentityConstraint.cs
- ExpressionVisitor.cs
- GuidConverter.cs
- ApplicationException.cs
- PointConverter.cs
- CompoundFileIOPermission.cs
- ParsedAttributeCollection.cs
- ChannelSinkStacks.cs
- TraceListeners.cs
- FieldToken.cs
- DecimalAnimation.cs
- wgx_exports.cs
- StringConcat.cs
- SystemException.cs
- TextTreeInsertElementUndoUnit.cs
- NegotiateStream.cs
- ToolStripItemDataObject.cs
- RoleService.cs
- EntityDataSourceUtil.cs
- CustomCategoryAttribute.cs
- DBCommand.cs
- SID.cs
- localization.cs
- HostedHttpRequestAsyncResult.cs
- BehaviorEditorPart.cs
- PointAnimationUsingPath.cs
- CompiledQueryCacheKey.cs
- RegexMatchCollection.cs
- EmptyControlCollection.cs
- LocatorManager.cs
- ListGeneralPage.cs
- ActionItem.cs
- Substitution.cs
- ParameterModifier.cs
- InstallerTypeAttribute.cs
- MatrixAnimationBase.cs
- RemoteWebConfigurationHostServer.cs