Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- EditingMode.cs
- CredentialCache.cs
- BufferedStream2.cs
- TransportSecurityHelpers.cs
- ChangeDirector.cs
- PolyLineSegmentFigureLogic.cs
- CapabilitiesSection.cs
- XmlAttributeCollection.cs
- HeaderedItemsControl.cs
- exports.cs
- CaseStatement.cs
- DataPagerFieldItem.cs
- Int32AnimationUsingKeyFrames.cs
- UriTemplateTrieNode.cs
- XmlIgnoreAttribute.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- DependencyPropertyChangedEventArgs.cs
- ButtonBaseAdapter.cs
- XsltException.cs
- TabRenderer.cs
- SqlInternalConnectionSmi.cs
- WriteableBitmap.cs
- XmlElementList.cs
- HttpDebugHandler.cs
- ProbeMatchesCD1.cs
- DataGridViewRowPrePaintEventArgs.cs
- DesignTimeVisibleAttribute.cs
- IdentifierService.cs
- DictionaryBase.cs
- HandlerMappingMemo.cs
- Window.cs
- typedescriptorpermissionattribute.cs
- QilTypeChecker.cs
- LayoutInformation.cs
- IDReferencePropertyAttribute.cs
- Tool.cs
- Profiler.cs
- MediaElement.cs
- EmptyEnumerator.cs
- EntityCollection.cs
- ProxyHwnd.cs
- WebZone.cs
- ClientEventManager.cs
- StringToken.cs
- MediaElementAutomationPeer.cs
- TextMarkerSource.cs
- CustomValidator.cs
- WaitingCursor.cs
- EntityDataSourceQueryBuilder.cs
- Viewport3DAutomationPeer.cs
- CapabilitiesPattern.cs
- Column.cs
- SuppressMergeCheckAttribute.cs
- SplineKeyFrames.cs
- EventLogSession.cs
- SSmlParser.cs
- AssemblyCacheEntry.cs
- ZipIOExtraFieldPaddingElement.cs
- MouseEvent.cs
- NameTable.cs
- ByteConverter.cs
- PriorityItem.cs
- AdRotatorDesigner.cs
- FamilyMap.cs
- FreezableCollection.cs
- SByteStorage.cs
- FacetValues.cs
- CodeConstructor.cs
- PositiveTimeSpanValidator.cs
- SchemaLookupTable.cs
- Grant.cs
- SocketAddress.cs
- ExecutionPropertyManager.cs
- SubqueryTrackingVisitor.cs
- PropertyChangedEventManager.cs
- ObjectDesignerDataSourceView.cs
- PipeStream.cs
- UriExt.cs
- ToolStripDropDownItem.cs
- GregorianCalendarHelper.cs
- IgnoreDataMemberAttribute.cs
- ListParaClient.cs
- WorkflowOperationInvoker.cs
- BitmapEffectState.cs
- WebServiceClientProxyGenerator.cs
- GC.cs
- SoapSchemaExporter.cs
- ActivityWithResultConverter.cs
- WebPartDescription.cs
- SHA1Managed.cs
- DesignOnlyAttribute.cs
- HierarchicalDataTemplate.cs
- Site.cs
- NumericUpDownAcceleration.cs
- HtmlTernaryTree.cs
- ChannelSinkStacks.cs
- FormViewInsertedEventArgs.cs
- DbQueryCommandTree.cs
- SignatureHelper.cs
- Vector3DKeyFrameCollection.cs