Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Channels / System / ServiceModel / Channels / ByteStreamBufferedMessageData.cs / 1305376 / ByteStreamBufferedMessageData.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Channels { using System; using System.Runtime; class ByteStreamBufferedMessageData { byte[] buffer; BufferManager bufferManager; int count; int refCount; public ByteStreamBufferedMessageData(byte[] buffer, int count) { this.buffer = buffer; this.count = count; this.refCount = 0; } public ByteStreamBufferedMessageData(BufferManager bufferManager, int count) { Fx.Assert(bufferManager != null, "bufferManager should not be null using this constructor"); this.buffer = bufferManager.TakeBuffer(count); this.bufferManager = bufferManager; this.count = count; this.refCount = 0; } public byte[] Buffer { get { return this.buffer; } } public int Count { get { return this.count; } } public void Open() { if (this.buffer != null) { this.refCount++; } } public void Close() { if (this.buffer != null) { if (--this.refCount <= 0) { if (this.bufferManager != null) { this.bufferManager.ReturnBuffer(this.buffer); } this.bufferManager = null; this.buffer = null; } } } } } // 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
- StateInitialization.cs
- RequestQueue.cs
- ApplicationDirectory.cs
- SymmetricCryptoHandle.cs
- AvTrace.cs
- AsymmetricKeyExchangeFormatter.cs
- XmlDataSource.cs
- CodeIdentifier.cs
- TemplateBaseAction.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- FieldMetadata.cs
- DesignTimeParseData.cs
- FuncTypeConverter.cs
- MembershipSection.cs
- TemplateBaseAction.cs
- ContextMarshalException.cs
- TypeProvider.cs
- WindowsRichEditRange.cs
- ElementProxy.cs
- InheritanceAttribute.cs
- ReadOnlyObservableCollection.cs
- Attachment.cs
- SQLByteStorage.cs
- _LazyAsyncResult.cs
- HttpHostedTransportConfiguration.cs
- Matrix3DStack.cs
- ExpressionBindings.cs
- WebScriptEnablingElement.cs
- DataException.cs
- CodeDelegateCreateExpression.cs
- BitmapCodecInfoInternal.cs
- ThousandthOfEmRealDoubles.cs
- DefaultTextStoreTextComposition.cs
- NativeMethods.cs
- SingleTagSectionHandler.cs
- ZoneMembershipCondition.cs
- RectAnimationUsingKeyFrames.cs
- RootBrowserWindowProxy.cs
- WorkflowMarkupSerializationManager.cs
- IChannel.cs
- RegexBoyerMoore.cs
- DummyDataSource.cs
- WebServiceClientProxyGenerator.cs
- DefaultEvaluationContext.cs
- TreeBuilder.cs
- TextServicesCompartmentEventSink.cs
- SettingsAttributeDictionary.cs
- WrappedIUnknown.cs
- StackSpiller.cs
- ScriptResourceHandler.cs
- TypeSystem.cs
- ResourceDisplayNameAttribute.cs
- SBCSCodePageEncoding.cs
- HtmlEncodedRawTextWriter.cs
- StylusCollection.cs
- NopReturnReader.cs
- DataServiceQuery.cs
- BuildProviderUtils.cs
- SafeMILHandleMemoryPressure.cs
- Adorner.cs
- ScrollProviderWrapper.cs
- FormViewUpdateEventArgs.cs
- ExpandableObjectConverter.cs
- BitmapData.cs
- XamlFigureLengthSerializer.cs
- List.cs
- SmtpLoginAuthenticationModule.cs
- SchemaTypeEmitter.cs
- StaticExtension.cs
- fixedPageContentExtractor.cs
- SynchronizedKeyedCollection.cs
- PKCS1MaskGenerationMethod.cs
- WrappedIUnknown.cs
- IsolatedStoragePermission.cs
- DataSetUtil.cs
- TdsParserSessionPool.cs
- ApplicationSettingsBase.cs
- EncryptedPackageFilter.cs
- ExceptionTrace.cs
- PropertyExpression.cs
- MessagePropertyFilter.cs
- FormatPage.cs
- String.cs
- DESCryptoServiceProvider.cs
- FloatUtil.cs
- RoleManagerEventArgs.cs
- SoapAttributeOverrides.cs
- DispatcherExceptionFilterEventArgs.cs
- InkCanvasAutomationPeer.cs
- ScaleTransform.cs
- PingReply.cs
- QueryOutputWriter.cs
- COM2IProvidePropertyBuilderHandler.cs
- DocumentApplicationDocumentViewer.cs
- TemplateDefinition.cs
- documentsequencetextview.cs
- ColumnMap.cs
- SqlClientWrapperSmiStreamChars.cs
- RootBrowserWindowAutomationPeer.cs
- WindowsUserNameSecurityTokenAuthenticator.cs