Code:
/ DotNET / DotNET / 8.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
- MenuAutomationPeer.cs
- EntryPointNotFoundException.cs
- RecognizedPhrase.cs
- TextEndOfParagraph.cs
- DSASignatureDeformatter.cs
- GZipStream.cs
- ConfigurationValidatorAttribute.cs
- BamlWriter.cs
- ClassDataContract.cs
- AsymmetricSignatureDeformatter.cs
- XmlElementList.cs
- HttpDictionary.cs
- SqlProviderServices.cs
- SingleResultAttribute.cs
- HttpCacheVaryByContentEncodings.cs
- FormCollection.cs
- _HeaderInfo.cs
- Simplifier.cs
- TrueReadOnlyCollection.cs
- handlecollector.cs
- CheckBoxList.cs
- Handle.cs
- TableRowCollection.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- InvalidFilterCriteriaException.cs
- CorrelationInitializer.cs
- ImageBrush.cs
- WindowsClaimSet.cs
- CardSpaceSelector.cs
- DbgUtil.cs
- ActiveXHost.cs
- LoginName.cs
- thaishape.cs
- ViewStateModeByIdAttribute.cs
- ControlEvent.cs
- TimelineGroup.cs
- BreakRecordTable.cs
- MarkerProperties.cs
- Table.cs
- PrintDialog.cs
- TypeDescriptionProvider.cs
- PrintingPermission.cs
- HttpListenerRequestUriBuilder.cs
- PackageProperties.cs
- ListDictionary.cs
- AttachmentService.cs
- SecurityDocument.cs
- VirtualDirectoryMapping.cs
- Evaluator.cs
- HtmlInputRadioButton.cs
- XMLSyntaxException.cs
- WindowsToolbarAsMenu.cs
- SerializationInfoEnumerator.cs
- DescendantQuery.cs
- ActivationArguments.cs
- ColumnMapTranslator.cs
- DecimalConstantAttribute.cs
- StringKeyFrameCollection.cs
- SmtpFailedRecipientException.cs
- URLIdentityPermission.cs
- ArrayWithOffset.cs
- ListParaClient.cs
- DialogResultConverter.cs
- OracleParameterCollection.cs
- SecurityChannelListener.cs
- EmbossBitmapEffect.cs
- CqlBlock.cs
- APCustomTypeDescriptor.cs
- HostedHttpTransportManager.cs
- CompiledQuery.cs
- WebResponse.cs
- NumericExpr.cs
- StorageEntitySetMapping.cs
- HtmlObjectListAdapter.cs
- TypeSystem.cs
- Semaphore.cs
- BindingContext.cs
- ResourceProperty.cs
- UnionCodeGroup.cs
- ValidatorUtils.cs
- SqlResolver.cs
- StringResourceManager.cs
- GridViewRow.cs
- SystemThemeKey.cs
- ImageBrush.cs
- HasCopySemanticsAttribute.cs
- AssertSection.cs
- QilValidationVisitor.cs
- XmlLinkedNode.cs
- followingquery.cs
- Matrix3DValueSerializer.cs
- DataBindingExpressionBuilder.cs
- AsymmetricSignatureDeformatter.cs
- FormsAuthenticationUserCollection.cs
- AsyncDataRequest.cs
- NegatedConstant.cs
- BookmarkManager.cs
- UncommonField.cs
- StorageComplexPropertyMapping.cs
- DispatcherTimer.cs