Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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 // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// 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
- SoapElementAttribute.cs
- TypeTypeConverter.cs
- ActiveXSite.cs
- AsyncResult.cs
- NavigationExpr.cs
- HttpListenerRequest.cs
- MarkupObject.cs
- PathTooLongException.cs
- Pair.cs
- Evidence.cs
- PartitionResolver.cs
- DictionarySurrogate.cs
- TypeListConverter.cs
- GenericArgumentsUpdater.cs
- MetabaseReader.cs
- GenericRootAutomationPeer.cs
- WebPartZoneCollection.cs
- ReaderWriterLockWrapper.cs
- ManagedWndProcTracker.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- XPathPatternBuilder.cs
- Utilities.cs
- PropertyBuilder.cs
- HttpListenerResponse.cs
- UnicastIPAddressInformationCollection.cs
- WebPartCatalogCloseVerb.cs
- HttpCapabilitiesBase.cs
- MsmqHostedTransportConfiguration.cs
- LicenseContext.cs
- FileEnumerator.cs
- DrawToolTipEventArgs.cs
- ArithmeticException.cs
- DesignConnectionCollection.cs
- _CookieModule.cs
- FormsAuthenticationModule.cs
- ContextMarshalException.cs
- Triplet.cs
- BatchStream.cs
- Util.cs
- ProxyAttribute.cs
- IdentityNotMappedException.cs
- ADMembershipProvider.cs
- ImageListStreamer.cs
- RawMouseInputReport.cs
- ContextItemManager.cs
- Triangle.cs
- AssemblyAttributes.cs
- GenerateTemporaryTargetAssembly.cs
- DocumentApplicationJournalEntry.cs
- CustomSignedXml.cs
- EventHandlerList.cs
- SizeChangedEventArgs.cs
- MultiAsyncResult.cs
- BuilderPropertyEntry.cs
- ExpanderAutomationPeer.cs
- HelpProvider.cs
- RegexStringValidatorAttribute.cs
- CompilerError.cs
- TypefaceMetricsCache.cs
- HttpContext.cs
- CodeDOMUtility.cs
- ChangesetResponse.cs
- EntityDataSourceState.cs
- Substitution.cs
- GuidTagList.cs
- __TransparentProxy.cs
- XmlKeywords.cs
- TextSimpleMarkerProperties.cs
- ServiceDurableInstance.cs
- LookupNode.cs
- ObjectSecurity.cs
- _Win32.cs
- Vector.cs
- JapaneseCalendar.cs
- Separator.cs
- CheckBoxList.cs
- TypeResolvingOptions.cs
- BindingExpression.cs
- DataBoundControl.cs
- ISAPIWorkerRequest.cs
- PropertyDescriptorComparer.cs
- JobStaple.cs
- ExpressionVisitorHelpers.cs
- TreeViewEvent.cs
- Ipv6Element.cs
- TextFormatterHost.cs
- COM2FontConverter.cs
- BooleanConverter.cs
- DeviceContext.cs
- CodeSubDirectoriesCollection.cs
- SettingsPropertyValueCollection.cs
- RetriableClipboard.cs
- EntryPointNotFoundException.cs
- ListViewUpdateEventArgs.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- control.ime.cs
- ConfigurationPermission.cs
- SqlNotificationEventArgs.cs
- ToolStripHighContrastRenderer.cs
- LabelLiteral.cs