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
- UiaCoreApi.cs
- RawStylusInputCustomData.cs
- ProgressBar.cs
- Baml2006SchemaContext.cs
- ApplicationActivator.cs
- ResourceReferenceKeyNotFoundException.cs
- UniformGrid.cs
- SqlProviderServices.cs
- ToolStripHighContrastRenderer.cs
- ValueUtilsSmi.cs
- IdnMapping.cs
- JsonQNameDataContract.cs
- GcSettings.cs
- AttributeProviderAttribute.cs
- HandlerBase.cs
- SHA512Managed.cs
- ToolStripPanelRow.cs
- ConnectionProviderAttribute.cs
- _UriTypeConverter.cs
- WorkerRequest.cs
- BStrWrapper.cs
- ButtonColumn.cs
- ContentElement.cs
- TabControlEvent.cs
- ToolStripItemTextRenderEventArgs.cs
- MessageQueuePermission.cs
- Facet.cs
- WindowProviderWrapper.cs
- TableColumn.cs
- PropertyContainer.cs
- DemultiplexingDispatchMessageFormatter.cs
- FileDetails.cs
- StreamResourceInfo.cs
- MD5CryptoServiceProvider.cs
- SqlDataSourceConfigureFilterForm.cs
- ThemeableAttribute.cs
- RestClientProxyHandler.cs
- LinqDataSourceView.cs
- PageCatalogPart.cs
- ProvideValueServiceProvider.cs
- ObjectDataSourceMethodEventArgs.cs
- httpapplicationstate.cs
- InternalTypeHelper.cs
- TdsParserSessionPool.cs
- XmlLoader.cs
- ADConnectionHelper.cs
- Cursor.cs
- ColorTransformHelper.cs
- WindowsBrush.cs
- FieldBuilder.cs
- HexParser.cs
- DefaultAsyncDataDispatcher.cs
- WebPartVerb.cs
- basecomparevalidator.cs
- Currency.cs
- EventHandlers.cs
- DbExpressionBuilder.cs
- VBCodeProvider.cs
- SudsParser.cs
- LastQueryOperator.cs
- CollectionView.cs
- ScriptReference.cs
- PropertyInfoSet.cs
- MouseCaptureWithinProperty.cs
- Win32Exception.cs
- IPPacketInformation.cs
- RequestSecurityTokenResponseCollection.cs
- EntityDesignerBuildProvider.cs
- Point3DAnimation.cs
- ProcessHostFactoryHelper.cs
- BamlLocalizationDictionary.cs
- SelectionGlyphBase.cs
- OpenTypeLayout.cs
- FtpRequestCacheValidator.cs
- DataGridViewDataErrorEventArgs.cs
- ReliableMessagingVersionConverter.cs
- RSAProtectedConfigurationProvider.cs
- rsa.cs
- CaseInsensitiveComparer.cs
- DataGridViewRowStateChangedEventArgs.cs
- ApplicationProxyInternal.cs
- ResponseStream.cs
- ExpressionBindingCollection.cs
- NetStream.cs
- ListViewInsertEventArgs.cs
- ProxyHwnd.cs
- RoleManagerSection.cs
- ProcessHostFactoryHelper.cs
- Util.cs
- GridSplitter.cs
- MeshGeometry3D.cs
- XPathAxisIterator.cs
- WebPartRestoreVerb.cs
- Avt.cs
- Int64Converter.cs
- DataBoundLiteralControl.cs
- InputReportEventArgs.cs
- Stylesheet.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- WebControl.cs