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
- ValidationSummary.cs
- GlyphTypeface.cs
- Matrix.cs
- MultiplexingDispatchMessageFormatter.cs
- SecurityPolicySection.cs
- SchemaAttDef.cs
- ModelUIElement3D.cs
- BuilderPropertyEntry.cs
- SourceSwitch.cs
- Hex.cs
- BuildProvider.cs
- PropertyManager.cs
- Point3DConverter.cs
- path.cs
- ObjectTag.cs
- TreeViewBindingsEditorForm.cs
- Trigger.cs
- XAMLParseException.cs
- SettingsAttributeDictionary.cs
- UnsafeNetInfoNativeMethods.cs
- ApplicationBuildProvider.cs
- IisTraceListener.cs
- CompoundFileStorageReference.cs
- SerializationAttributes.cs
- RawStylusInputCustomDataList.cs
- TreeView.cs
- ColorTransform.cs
- CellConstant.cs
- NumericUpDown.cs
- TextSelectionProcessor.cs
- ChannelManager.cs
- UnauthorizedWebPart.cs
- StreamAsIStream.cs
- ProcessDesigner.cs
- ByValueEqualityComparer.cs
- InstallerTypeAttribute.cs
- Freezable.cs
- InputMethodStateChangeEventArgs.cs
- MsmqMessage.cs
- SlipBehavior.cs
- XmlCDATASection.cs
- CrossAppDomainChannel.cs
- Cursor.cs
- XmlSerializerNamespaces.cs
- RegionInfo.cs
- BookmarkUndoUnit.cs
- EndEvent.cs
- SapiRecoInterop.cs
- PagedDataSource.cs
- ColumnBinding.cs
- ToolStripTemplateNode.cs
- AssemblyBuilder.cs
- ListSourceHelper.cs
- DbDataAdapter.cs
- Win32Native.cs
- AccessKeyManager.cs
- DetailsViewRowCollection.cs
- XpsResource.cs
- SharedStatics.cs
- StringResourceManager.cs
- FamilyMapCollection.cs
- EnlistmentState.cs
- DataSysAttribute.cs
- PerfCounterSection.cs
- Convert.cs
- CaseInsensitiveHashCodeProvider.cs
- ManifestResourceInfo.cs
- StringValidator.cs
- SmtpFailedRecipientsException.cs
- LabelDesigner.cs
- RequiredFieldValidator.cs
- PropertyDescriptor.cs
- CommandBinding.cs
- RIPEMD160Managed.cs
- HtmlWindow.cs
- EventSetter.cs
- DataList.cs
- EncryptedKeyHashIdentifierClause.cs
- Relationship.cs
- BooleanExpr.cs
- ExceptQueryOperator.cs
- SmiGettersStream.cs
- ClientConfigurationSystem.cs
- SharedTcpTransportManager.cs
- BStrWrapper.cs
- FontStretch.cs
- CellIdBoolean.cs
- CompiledQueryCacheEntry.cs
- RelationshipEndMember.cs
- HttpCookie.cs
- ExpressionParser.cs
- StickyNoteAnnotations.cs
- BitStream.cs
- ModelMemberCollection.cs
- DataGridViewRowStateChangedEventArgs.cs
- translator.cs
- _NestedSingleAsyncResult.cs
- StorageEntityContainerMapping.cs
- GeneratedCodeAttribute.cs
- ZipPackage.cs