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
- OleDbWrapper.cs
- ObjectDesignerDataSourceView.cs
- FormClosedEvent.cs
- WebPartZoneCollection.cs
- IISMapPath.cs
- StringSorter.cs
- PathFigure.cs
- DataGridViewSelectedColumnCollection.cs
- AddInController.cs
- SmtpTransport.cs
- HttpHeaderCollection.cs
- KeyboardNavigation.cs
- ErrorRuntimeConfig.cs
- EntityProviderServices.cs
- GenericIdentity.cs
- XmlAttribute.cs
- UpDownEvent.cs
- LinkedResourceCollection.cs
- StringDictionary.cs
- DeviceContexts.cs
- ParseChildrenAsPropertiesAttribute.cs
- EvidenceTypeDescriptor.cs
- TemplateInstanceAttribute.cs
- SqlPersistenceProviderFactory.cs
- ComNativeDescriptor.cs
- ParagraphVisual.cs
- Win32.cs
- Validator.cs
- CellConstant.cs
- ZeroOpNode.cs
- DataGridLinkButton.cs
- EntityDataSourceSelectingEventArgs.cs
- ServiceEndpointElementCollection.cs
- PathStreamGeometryContext.cs
- ExceptionUtil.cs
- SessionEndingCancelEventArgs.cs
- DrawingImage.cs
- TextOptions.cs
- xamlnodes.cs
- ProxyManager.cs
- TargetException.cs
- DataGridViewCellCancelEventArgs.cs
- MouseActionConverter.cs
- SafeNativeMethods.cs
- HandlerWithFactory.cs
- WebPartZoneBaseDesigner.cs
- TextEditorCopyPaste.cs
- ToolStripItemEventArgs.cs
- ExpandableObjectConverter.cs
- ZipFileInfo.cs
- Operator.cs
- ListComponentEditor.cs
- WebControlAdapter.cs
- OwnerDrawPropertyBag.cs
- WindowsAltTab.cs
- Size.cs
- ThemeableAttribute.cs
- ToolTipService.cs
- ValidationRule.cs
- DomNameTable.cs
- WindowsListViewItemStartMenu.cs
- BitmapEffectState.cs
- IDReferencePropertyAttribute.cs
- DependencyPropertyValueSerializer.cs
- ErrorWrapper.cs
- EdmItemCollection.cs
- DrawingVisual.cs
- SafeNativeMethods.cs
- WebBrowserHelper.cs
- UpdatePanelTrigger.cs
- KeyTimeConverter.cs
- TargetParameterCountException.cs
- EraserBehavior.cs
- XPathDocumentNavigator.cs
- UriExt.cs
- BoundingRectTracker.cs
- OraclePermission.cs
- HttpPostedFile.cs
- RegexCaptureCollection.cs
- TextEditorParagraphs.cs
- WorkflowPersistenceService.cs
- BindingMAnagerBase.cs
- ProgramPublisher.cs
- BuildProviderCollection.cs
- storagemappingitemcollection.viewdictionary.cs
- NameSpaceExtractor.cs
- CodePrimitiveExpression.cs
- InterleavedZipPartStream.cs
- IODescriptionAttribute.cs
- Quaternion.cs
- Activity.cs
- XsdBuildProvider.cs
- InfoCardMasterKey.cs
- SqlUDTStorage.cs
- WebPartAuthorizationEventArgs.cs
- SymmetricAlgorithm.cs
- XmlSchemaAttributeGroup.cs
- HwndHostAutomationPeer.cs
- TransformerInfo.cs
- XmlSchemaAppInfo.cs