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
- ChtmlMobileTextWriter.cs
- EnvironmentPermission.cs
- Annotation.cs
- QilBinary.cs
- Evidence.cs
- WsiProfilesElement.cs
- ElementNotAvailableException.cs
- PolicyImporterElementCollection.cs
- AssertUtility.cs
- RegistryDataKey.cs
- SelectorItemAutomationPeer.cs
- SqlCaseSimplifier.cs
- MatrixConverter.cs
- SerialReceived.cs
- Empty.cs
- UserMapPath.cs
- BezierSegment.cs
- XmlElementCollection.cs
- ListItemConverter.cs
- KnownBoxes.cs
- TreeNodeCollectionEditor.cs
- BitStack.cs
- SrgsDocument.cs
- WebServicesSection.cs
- TableSectionStyle.cs
- PropertyToken.cs
- AsyncSerializedWorker.cs
- ElementsClipboardData.cs
- ActivityExecutionContext.cs
- SmtpNtlmAuthenticationModule.cs
- DataGridViewToolTip.cs
- RecordConverter.cs
- WebContentFormatHelper.cs
- TabPanel.cs
- DataObjectMethodAttribute.cs
- ListBindingHelper.cs
- ObjectDisposedException.cs
- MemberCollection.cs
- BindingFormattingDialog.cs
- HtmlShim.cs
- MenuCommandsChangedEventArgs.cs
- ObjectToIdCache.cs
- DynamicValidatorEventArgs.cs
- XmlSchemaSequence.cs
- VolatileEnlistmentState.cs
- TypeInfo.cs
- AttributeEmitter.cs
- EntityContainerEmitter.cs
- MessageSecurityOverTcp.cs
- Math.cs
- TextEditorCopyPaste.cs
- DebugView.cs
- SystemIcmpV4Statistics.cs
- WmlLabelAdapter.cs
- DBCommand.cs
- ServerValidateEventArgs.cs
- TabControlEvent.cs
- ParallelLoopState.cs
- XPathScanner.cs
- WindowsScrollBar.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- SqlHelper.cs
- ToolStripItemDesigner.cs
- FormViewInsertedEventArgs.cs
- Int32AnimationBase.cs
- ErrorFormatter.cs
- XmlSchemaAnyAttribute.cs
- BoolExpression.cs
- CatalogPart.cs
- SmiRequestExecutor.cs
- WmpBitmapDecoder.cs
- DataKeyPropertyAttribute.cs
- SplineKeyFrames.cs
- DecoratedNameAttribute.cs
- ConnectionProviderAttribute.cs
- LinearKeyFrames.cs
- ADMembershipUser.cs
- FacetChecker.cs
- FormatConvertedBitmap.cs
- ISFTagAndGuidCache.cs
- FileReader.cs
- ModelItemDictionaryImpl.cs
- RestHandler.cs
- ScriptServiceAttribute.cs
- WinEventTracker.cs
- BaseParagraph.cs
- UpnEndpointIdentityExtension.cs
- IFlowDocumentViewer.cs
- WindowsFont.cs
- WebPartsPersonalization.cs
- TextEndOfParagraph.cs
- precedingsibling.cs
- CustomCredentialPolicy.cs
- SqlDataReaderSmi.cs
- CapabilitiesUse.cs
- XmlNavigatorFilter.cs
- ToolStripArrowRenderEventArgs.cs
- CompoundFileStorageReference.cs
- DesignerDataTableBase.cs
- BindingRestrictions.cs