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
- PeerCredential.cs
- PeerToPeerException.cs
- HtmlTableCell.cs
- RichTextBoxDesigner.cs
- AuthenticationService.cs
- Point3DKeyFrameCollection.cs
- BindingBase.cs
- TypeKeyValue.cs
- WebPart.cs
- CachingHintValidation.cs
- ContentIterators.cs
- SessionIDManager.cs
- SecurityChannelFaultConverter.cs
- TrackingSection.cs
- Bezier.cs
- BindingCollection.cs
- IImplicitResourceProvider.cs
- CapabilitiesState.cs
- IntegerValidator.cs
- TextDecoration.cs
- cookieexception.cs
- XmlAttributeOverrides.cs
- BaseDataList.cs
- XmlSerializerFormatAttribute.cs
- XmlCharacterData.cs
- ObjectConverter.cs
- HttpGetProtocolImporter.cs
- BitmapData.cs
- CodeExpressionCollection.cs
- ApplicationFileCodeDomTreeGenerator.cs
- COM2ExtendedUITypeEditor.cs
- ZipIORawDataFileBlock.cs
- BitSet.cs
- COSERVERINFO.cs
- MouseGestureValueSerializer.cs
- odbcmetadatacollectionnames.cs
- ApplicationSecurityManager.cs
- WorkflowHostingEndpoint.cs
- PolygonHotSpot.cs
- SaveFileDialog.cs
- ValidatedControlConverter.cs
- NetTcpSecurity.cs
- DataKeyArray.cs
- ListBindableAttribute.cs
- SelectionProviderWrapper.cs
- SqlDataSourceConfigureFilterForm.cs
- Exception.cs
- _StreamFramer.cs
- DefaultWorkflowTransactionService.cs
- CompiledQueryCacheEntry.cs
- RayHitTestParameters.cs
- PassportAuthenticationEventArgs.cs
- RoleServiceManager.cs
- TemplateControlCodeDomTreeGenerator.cs
- AppliesToBehaviorDecisionTable.cs
- ActivityBuilderHelper.cs
- KeyMatchBuilder.cs
- ArrangedElement.cs
- HtmlInputCheckBox.cs
- TextBoxBase.cs
- LockedHandleGlyph.cs
- XmlTextWriter.cs
- HtmlInputImage.cs
- GridItemPattern.cs
- ListControlConvertEventArgs.cs
- SqlNotificationRequest.cs
- QuaternionAnimation.cs
- DesignerSerializationVisibilityAttribute.cs
- serverconfig.cs
- AssemblyName.cs
- Propagator.JoinPropagator.cs
- PropertyGrid.cs
- RowUpdatedEventArgs.cs
- LinearGradientBrush.cs
- QueryCacheManager.cs
- ParamArrayAttribute.cs
- ContextBase.cs
- EventRecord.cs
- DesignTimeParseData.cs
- HtmlInputPassword.cs
- VScrollProperties.cs
- HTMLTextWriter.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ToolStripScrollButton.cs
- JoinQueryOperator.cs
- BoolExpression.cs
- TemplateContentLoader.cs
- AssemblyAttributesGoHere.cs
- XPathExpr.cs
- XmlDeclaration.cs
- StandardTransformFactory.cs
- ValidationRule.cs
- MD5.cs
- RoleGroupCollectionEditor.cs
- RNGCryptoServiceProvider.cs
- WebConfigurationHost.cs
- CallbackWrapper.cs
- BaseProcessor.cs
- IProvider.cs
- ExpressionStringBuilder.cs