Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / _BufferOffsetSize.cs / 1305376 / _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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WindowsUserNameSecurityTokenAuthenticator.cs
- XPathBuilder.cs
- SrgsNameValueTag.cs
- WorkflowViewElement.cs
- DesignerVerbCollection.cs
- BuilderPropertyEntry.cs
- SqlDataReader.cs
- CriticalHandle.cs
- AnnotationResourceCollection.cs
- DataGridViewRowConverter.cs
- PropertyRecord.cs
- BuildDependencySet.cs
- VariableAction.cs
- SerializableAttribute.cs
- EventDriven.cs
- BitmapDownload.cs
- ObjectQuery_EntitySqlExtensions.cs
- Identifier.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- COM2Properties.cs
- StaticTextPointer.cs
- ViewUtilities.cs
- DataKey.cs
- RenderDataDrawingContext.cs
- FontCollection.cs
- Keywords.cs
- TypeUsageBuilder.cs
- Odbc32.cs
- XmlSchemaType.cs
- XmlSchemaSimpleContent.cs
- XmlTypeAttribute.cs
- WindowsGraphicsCacheManager.cs
- SafeEventLogReadHandle.cs
- SafeMILHandleMemoryPressure.cs
- log.cs
- OracleParameter.cs
- CodeNamespaceImportCollection.cs
- Module.cs
- EffectiveValueEntry.cs
- StickyNoteContentControl.cs
- DataSetUtil.cs
- GregorianCalendar.cs
- TimeEnumHelper.cs
- Expressions.cs
- QuerySetOp.cs
- ThicknessConverter.cs
- GreaterThanOrEqual.cs
- InkCanvasFeedbackAdorner.cs
- QueryExpression.cs
- GcHandle.cs
- CounterCreationDataCollection.cs
- QuotedStringWriteStateInfo.cs
- MaskDescriptors.cs
- SecurityContext.cs
- DelegatingHeader.cs
- MenuItemCollectionEditorDialog.cs
- OracleDateTime.cs
- InternalsVisibleToAttribute.cs
- DataGridParentRows.cs
- NegatedConstant.cs
- UnsafeNativeMethods.cs
- XPathNode.cs
- FillErrorEventArgs.cs
- HighlightVisual.cs
- Errors.cs
- FormViewRow.cs
- DesignerActionService.cs
- WindowsHyperlink.cs
- DataContractSet.cs
- SafeHandles.cs
- OutArgument.cs
- XmlReturnWriter.cs
- DSASignatureDeformatter.cs
- SqlExpander.cs
- HttpRuntime.cs
- CoTaskMemUnicodeSafeHandle.cs
- PipelineModuleStepContainer.cs
- TypeSystemProvider.cs
- TableDetailsCollection.cs
- StrongNameMembershipCondition.cs
- DataObjectAttribute.cs
- TextCollapsingProperties.cs
- DataGridItemCollection.cs
- DefaultParameterValueAttribute.cs
- ProxyAttribute.cs
- DispatchOperation.cs
- BamlRecordReader.cs
- MatrixTransform.cs
- _FixedSizeReader.cs
- DbInsertCommandTree.cs
- JsonEncodingStreamWrapper.cs
- XPathDocumentIterator.cs
- HttpRequestCacheValidator.cs
- ColumnHeaderConverter.cs
- Italic.cs
- DataMemberFieldConverter.cs
- IteratorFilter.cs
- IteratorFilter.cs
- _ListenerResponseStream.cs
- TextElementAutomationPeer.cs