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
- RuntimeArgumentHandle.cs
- RegexMatch.cs
- AutoSizeComboBox.cs
- OSFeature.cs
- EntityParameterCollection.cs
- CardSpaceShim.cs
- DataGridViewCellStyle.cs
- StickyNoteHelper.cs
- ToolStripContainerDesigner.cs
- IntSecurity.cs
- X500Name.cs
- XmlDataSourceNodeDescriptor.cs
- StylusSystemGestureEventArgs.cs
- SerializationIncompleteException.cs
- RadioButtonList.cs
- BinaryUtilClasses.cs
- Stack.cs
- FixedSchema.cs
- BuildProvider.cs
- SecurityDescriptor.cs
- TextContainer.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- HyperlinkAutomationPeer.cs
- FullTextState.cs
- TdsParameterSetter.cs
- HttpListenerPrefixCollection.cs
- GridViewPageEventArgs.cs
- ZipFileInfoCollection.cs
- SchemaInfo.cs
- LeafCellTreeNode.cs
- DataGridViewRowEventArgs.cs
- WindowsGraphics2.cs
- Fonts.cs
- basenumberconverter.cs
- NavigatorOutput.cs
- EdmScalarPropertyAttribute.cs
- APCustomTypeDescriptor.cs
- RequestQueue.cs
- Group.cs
- WCFServiceClientProxyGenerator.cs
- DocumentViewerHelper.cs
- SchemaImporterExtensionElement.cs
- AnnotationDocumentPaginator.cs
- ClientData.cs
- SqlCharStream.cs
- PageAsyncTaskManager.cs
- MaterialGroup.cs
- SvcMapFileSerializer.cs
- InvokeMethodActivity.cs
- ColumnCollection.cs
- CommandField.cs
- NetworkStream.cs
- FilteredXmlReader.cs
- SoapParser.cs
- StateChangeEvent.cs
- Directory.cs
- ClientRuntimeConfig.cs
- XmlCharCheckingWriter.cs
- EntityDataSourceChangedEventArgs.cs
- TableItemPattern.cs
- EasingKeyFrames.cs
- ConfigXmlText.cs
- DragSelectionMessageFilter.cs
- WizardPanel.cs
- OleDbReferenceCollection.cs
- PtsHelper.cs
- MDIWindowDialog.cs
- StructuredTypeInfo.cs
- FormViewInsertedEventArgs.cs
- BitmapMetadata.cs
- DBDataPermissionAttribute.cs
- ImageListImageEditor.cs
- RemotingConfiguration.cs
- VoiceChangeEventArgs.cs
- SchemaContext.cs
- URL.cs
- NavigationPropertyEmitter.cs
- ChtmlSelectionListAdapter.cs
- FileUtil.cs
- Form.cs
- Console.cs
- XmlReflectionImporter.cs
- RadioButton.cs
- StringUtil.cs
- SerializationEventsCache.cs
- XmlExtensionFunction.cs
- DataSourceControlBuilder.cs
- BitmapEffect.cs
- MessageAction.cs
- NativeMethodsOther.cs
- LineServices.cs
- ServiceSecurityContext.cs
- XmlSchemaObjectCollection.cs
- IPAddress.cs
- Point3DIndependentAnimationStorage.cs
- DesignerListAdapter.cs
- FrugalList.cs
- GB18030Encoding.cs
- EventLogPermission.cs
- ArgumentOutOfRangeException.cs