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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ITextView.cs
- InputBinder.cs
- NonBatchDirectoryCompiler.cs
- DataChangedEventManager.cs
- DataSetSchema.cs
- OdbcCommand.cs
- ItemsControlAutomationPeer.cs
- XmlAnyElementAttribute.cs
- TreeNodeClickEventArgs.cs
- ClientSideProviderDescription.cs
- ObjectTypeMapping.cs
- TraceHandler.cs
- FilterUserControlBase.cs
- PaintEvent.cs
- FileDialog.cs
- XmlIlTypeHelper.cs
- _NTAuthentication.cs
- DbMetaDataFactory.cs
- AlphabeticalEnumConverter.cs
- LoginView.cs
- MSAAEventDispatcher.cs
- XmlRawWriter.cs
- BulletChrome.cs
- ConfigXmlText.cs
- TextAnchor.cs
- DetailsViewUpdatedEventArgs.cs
- ManualResetEvent.cs
- Rotation3DKeyFrameCollection.cs
- HttpListenerException.cs
- CodeIdentifier.cs
- EditorZoneAutoFormat.cs
- TraceSource.cs
- ModelEditingScope.cs
- BamlLocalizabilityResolver.cs
- ManagementExtension.cs
- Point.cs
- QuestionEventArgs.cs
- StyleBamlRecordReader.cs
- ObservableCollection.cs
- CollectionsUtil.cs
- ASCIIEncoding.cs
- OutputCacheEntry.cs
- WizardPanelChangingEventArgs.cs
- Semaphore.cs
- Material.cs
- XPathDocumentNavigator.cs
- DependencyPropertyDescriptor.cs
- CodeGroup.cs
- ListViewItem.cs
- XmlSchemaExternal.cs
- TCEAdapterGenerator.cs
- TypeExtensionConverter.cs
- TextBoxDesigner.cs
- TimeStampChecker.cs
- WebPartTransformerAttribute.cs
- ListViewTableCell.cs
- CommonProperties.cs
- EncoderNLS.cs
- SoapCodeExporter.cs
- ProcessProtocolHandler.cs
- DynamicField.cs
- MsmqReceiveHelper.cs
- RNGCryptoServiceProvider.cs
- ContextInformation.cs
- SingleStorage.cs
- TransactionalPackage.cs
- DesignerActionVerbList.cs
- CFStream.cs
- TimeoutValidationAttribute.cs
- MatrixAnimationUsingPath.cs
- NamespaceQuery.cs
- NameSpaceExtractor.cs
- SecurityCapabilities.cs
- DBSqlParserTableCollection.cs
- SmiEventSink_DeferedProcessing.cs
- DisposableCollectionWrapper.cs
- ClientTargetSection.cs
- ContentType.cs
- MatrixValueSerializer.cs
- RtfToken.cs
- ChannelManager.cs
- ViewGenResults.cs
- BCLDebug.cs
- Parsers.cs
- CatalogPart.cs
- TextEditorSelection.cs
- LayoutManager.cs
- ValidationUtility.cs
- LassoSelectionBehavior.cs
- FlowDocumentPage.cs
- OpenTypeCommon.cs
- TreeWalker.cs
- TCPListener.cs
- Parser.cs
- _WebProxyDataBuilder.cs
- WorkflowLayouts.cs
- WebServiceMethodData.cs
- OverrideMode.cs
- DefaultPropertyAttribute.cs
- ClientBuildManagerCallback.cs