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
- ViewKeyConstraint.cs
- ScrollableControlDesigner.cs
- CheckBox.cs
- DesignTimeParseData.cs
- IntSecurity.cs
- RoleService.cs
- DecimalConstantAttribute.cs
- FontConverter.cs
- RelationshipWrapper.cs
- PropertySourceInfo.cs
- SafeLibraryHandle.cs
- WebPartConnectionsEventArgs.cs
- ValidatingReaderNodeData.cs
- InkCanvasSelection.cs
- ObjectItemCollection.cs
- StylesEditorDialog.cs
- JsonReaderDelegator.cs
- TextFormatter.cs
- DesignerView.cs
- AnnotationStore.cs
- StagingAreaInputItem.cs
- PipelineModuleStepContainer.cs
- TreeViewImageGenerator.cs
- OdbcEnvironment.cs
- CodeGenHelper.cs
- WinFormsSecurity.cs
- StorageModelBuildProvider.cs
- OutputWindow.cs
- SmtpAuthenticationManager.cs
- PrincipalPermission.cs
- RuntimeConfig.cs
- ProviderConnectionPointCollection.cs
- RangeValidator.cs
- TemplatePagerField.cs
- Int32CAMarshaler.cs
- ISO2022Encoding.cs
- ConversionContext.cs
- PriorityRange.cs
- SynchronizingStream.cs
- SpecialNameAttribute.cs
- EntityCodeGenerator.cs
- SlotInfo.cs
- InfoCardSymmetricAlgorithm.cs
- WriterOutput.cs
- FlowDocumentPage.cs
- ProgressChangedEventArgs.cs
- Psha1DerivedKeyGenerator.cs
- SafeThreadHandle.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- LayoutManager.cs
- ScrollBar.cs
- Sentence.cs
- Geometry3D.cs
- StylusCaptureWithinProperty.cs
- XmlDataSource.cs
- ReferencedCollectionType.cs
- StandardTransformFactory.cs
- NamespaceCollection.cs
- ExtensionWindow.cs
- MessageEncodingBindingElement.cs
- TaskFormBase.cs
- MembershipAdapter.cs
- LiteralTextContainerControlBuilder.cs
- ActivityDesigner.cs
- ValueExpressions.cs
- XAMLParseException.cs
- BehaviorDragDropEventArgs.cs
- SqlUDTStorage.cs
- SecurityDescriptor.cs
- RootBuilder.cs
- ConnectionStringsExpressionEditor.cs
- IndentTextWriter.cs
- QilBinary.cs
- Animatable.cs
- EventToken.cs
- SharedUtils.cs
- TextureBrush.cs
- LineGeometry.cs
- AesCryptoServiceProvider.cs
- ForeignKeyConstraint.cs
- ObjectPropertyMapping.cs
- SecurityContextCookieSerializer.cs
- TypeUtils.cs
- DataMisalignedException.cs
- DbLambda.cs
- SmtpAuthenticationManager.cs
- EndpointIdentityConverter.cs
- KnownTypesHelper.cs
- X509CertificateTrustedIssuerElementCollection.cs
- WorkflowRuntimeServiceElementCollection.cs
- FileSecurity.cs
- tooltip.cs
- PagesSection.cs
- ElementsClipboardData.cs
- ColorAnimationBase.cs
- ArrayConverter.cs
- Vector.cs
- Recipient.cs
- ZipIOExtraFieldElement.cs
- ProcessHost.cs