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
- NumberFormatInfo.cs
- NonParentingControl.cs
- RelationshipEndMember.cs
- LicenseException.cs
- BaseTemplateBuildProvider.cs
- _SingleItemRequestCache.cs
- ConfigPathUtility.cs
- TypeHelper.cs
- StorageAssociationTypeMapping.cs
- DCSafeHandle.cs
- DataGridCellAutomationPeer.cs
- GroupStyle.cs
- Array.cs
- CompileXomlTask.cs
- ExpandSegmentCollection.cs
- NameNode.cs
- ObjectConverter.cs
- CreateUserWizard.cs
- DtdParser.cs
- SvcMapFileSerializer.cs
- UnmanagedMarshal.cs
- DbParameterCollectionHelper.cs
- UIPermission.cs
- EntityTypeBase.cs
- LazyInitializer.cs
- StickyNote.cs
- UserControlCodeDomTreeGenerator.cs
- AttributeSetAction.cs
- DBConnection.cs
- NamespaceCollection.cs
- StorageComplexTypeMapping.cs
- WebEventCodes.cs
- WorkflowRuntimeServiceElement.cs
- NotImplementedException.cs
- ViewCellSlot.cs
- RegularExpressionValidator.cs
- Html32TextWriter.cs
- UInt64Storage.cs
- ForEachAction.cs
- ModelUIElement3D.cs
- MailAddress.cs
- COM2ExtendedTypeConverter.cs
- KeyValueConfigurationCollection.cs
- InputDevice.cs
- securitymgrsite.cs
- NumericExpr.cs
- HyperLinkField.cs
- DictionaryMarkupSerializer.cs
- HttpServerUtilityWrapper.cs
- Nullable.cs
- ValidateNames.cs
- CroppedBitmap.cs
- CustomErrorsSection.cs
- ToolStripDropDownClosingEventArgs.cs
- LicenseProviderAttribute.cs
- Message.cs
- BrowserCapabilitiesFactoryBase.cs
- WorkflowMarkupSerializationManager.cs
- CapabilitiesRule.cs
- CodeMemberEvent.cs
- DataServiceException.cs
- basenumberconverter.cs
- FunctionQuery.cs
- UserPreferenceChangedEventArgs.cs
- RequestDescription.cs
- TypeBrowser.xaml.cs
- GridViewDeletedEventArgs.cs
- KnownBoxes.cs
- QilTypeChecker.cs
- CategoryNameCollection.cs
- ForeignConstraint.cs
- PenCursorManager.cs
- Win32SafeHandles.cs
- ProviderSettingsCollection.cs
- CacheChildrenQuery.cs
- COM2IDispatchConverter.cs
- XmlArrayAttribute.cs
- TCPClient.cs
- UIElement.cs
- UpDownEvent.cs
- ListControl.cs
- OleDbConnectionFactory.cs
- IISMapPath.cs
- KeyboardEventArgs.cs
- MethodBody.cs
- DataGridViewCellStyleConverter.cs
- ReadOnlyDataSourceView.cs
- ProfileManager.cs
- ClonableStack.cs
- DecoderNLS.cs
- SkewTransform.cs
- DesignerPerfEventProvider.cs
- ConfigurationSectionGroup.cs
- WebPartTransformerCollection.cs
- LambdaCompiler.Statements.cs
- MsmqOutputSessionChannel.cs
- connectionpool.cs
- FloaterBaseParagraph.cs
- TextLineResult.cs
- AuthorizationRule.cs