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
- Brush.cs
- KeyNotFoundException.cs
- ScalarOps.cs
- GeneralTransform2DTo3D.cs
- JsonWriter.cs
- JsonWriterDelegator.cs
- XmlParserContext.cs
- CssClassPropertyAttribute.cs
- AppSettingsSection.cs
- IdSpace.cs
- GuidTagList.cs
- ReaderOutput.cs
- XsltConvert.cs
- ProcessHostConfigUtils.cs
- WebPartMenuStyle.cs
- SqlError.cs
- PeerCredential.cs
- BitmapData.cs
- RSATokenProvider.cs
- StyleTypedPropertyAttribute.cs
- StaticFileHandler.cs
- ClearTypeHintValidation.cs
- TextureBrush.cs
- ZipIOModeEnforcingStream.cs
- DrawingContextDrawingContextWalker.cs
- Padding.cs
- HelpEvent.cs
- ConsumerConnectionPointCollection.cs
- ProviderUtil.cs
- PasswordRecovery.cs
- COMException.cs
- MultiDataTrigger.cs
- AuthorizationSection.cs
- DataObjectCopyingEventArgs.cs
- ChtmlMobileTextWriter.cs
- WriteableBitmap.cs
- HttpBufferlessInputStream.cs
- FormViewInsertEventArgs.cs
- RealizationContext.cs
- ConfigurationManagerInternal.cs
- CodeEventReferenceExpression.cs
- cookiecollection.cs
- ItemsControlAutomationPeer.cs
- DefaultCommandConverter.cs
- UxThemeWrapper.cs
- printdlgexmarshaler.cs
- PageThemeCodeDomTreeGenerator.cs
- EnumMember.cs
- PersonalizationState.cs
- ObjectTag.cs
- AlgoModule.cs
- XmlSchemaResource.cs
- ExtendedPropertiesHandler.cs
- ColorContextHelper.cs
- SystemIcons.cs
- CreateUserErrorEventArgs.cs
- TextParagraphProperties.cs
- FactoryMaker.cs
- ClientTargetSection.cs
- SqlXml.cs
- ListDictionary.cs
- RuleCache.cs
- CodeTypeParameterCollection.cs
- FileVersionInfo.cs
- MultipartContentParser.cs
- CodeVariableDeclarationStatement.cs
- StringStorage.cs
- BufferedStream.cs
- XmlNodeComparer.cs
- AbandonedMutexException.cs
- DbXmlEnabledProviderManifest.cs
- LoadWorkflowCommand.cs
- WebPartConnectionCollection.cs
- PeerApplicationLaunchInfo.cs
- NonParentingControl.cs
- ReadOnlyHierarchicalDataSourceView.cs
- StringValueSerializer.cs
- MarkupCompiler.cs
- HtmlImage.cs
- TextPenaltyModule.cs
- PixelFormats.cs
- FunctionCommandText.cs
- HttpModulesInstallComponent.cs
- pingexception.cs
- XmlUtilWriter.cs
- LocalizableResourceBuilder.cs
- DataControlFieldTypeEditor.cs
- XmlNamedNodeMap.cs
- XmlUnspecifiedAttribute.cs
- XmlValueConverter.cs
- Deserializer.cs
- XmlSchemaComplexContentRestriction.cs
- AutoGeneratedField.cs
- NullableBoolConverter.cs
- EntityTypeBase.cs
- XmlArrayAttribute.cs
- _DigestClient.cs
- Int32CAMarshaler.cs
- RotateTransform.cs
- FieldAccessException.cs