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
- AutoFocusStyle.xaml.cs
- XmlCDATASection.cs
- Bitmap.cs
- Scalars.cs
- CodeRegionDirective.cs
- DataReceivedEventArgs.cs
- StylusTip.cs
- PropertyConverter.cs
- ProbeDuplex11AsyncResult.cs
- DataBindingCollection.cs
- Compress.cs
- Monitor.cs
- DataGridViewTopLeftHeaderCell.cs
- MethodRental.cs
- StateBag.cs
- MetabaseServerConfig.cs
- ApplicationInfo.cs
- RoleService.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ConfigurationManagerHelper.cs
- WebPartsPersonalizationAuthorization.cs
- TemplateField.cs
- RectValueSerializer.cs
- AsyncOperationContext.cs
- FixedSOMElement.cs
- RepeatInfo.cs
- HMACRIPEMD160.cs
- LongPath.cs
- EntityContainerAssociationSet.cs
- BindingSource.cs
- SubtreeProcessor.cs
- EntityDataSourceEntityTypeFilterItem.cs
- EtwTrackingParticipant.cs
- TextServicesCompartmentContext.cs
- BindingValueChangedEventArgs.cs
- fixedPageContentExtractor.cs
- Region.cs
- TypeDelegator.cs
- QueryableDataSource.cs
- BrowserTree.cs
- WpfWebRequestHelper.cs
- NativeRecognizer.cs
- Literal.cs
- SR.cs
- NavigateEvent.cs
- SqlDataSourceStatusEventArgs.cs
- OleDbCommand.cs
- DbCommandDefinition.cs
- GeneralTransform2DTo3DTo2D.cs
- ListenerConnectionModeReader.cs
- BinaryObjectWriter.cs
- KeyboardEventArgs.cs
- XmlAttributeProperties.cs
- HtmlInputButton.cs
- SkewTransform.cs
- PrimitiveType.cs
- DataSysAttribute.cs
- DuplicateWaitObjectException.cs
- XamlReaderHelper.cs
- StateChangeEvent.cs
- CultureInfoConverter.cs
- FormViewAutoFormat.cs
- ContentPlaceHolder.cs
- BamlRecords.cs
- InvocationExpression.cs
- SafeNativeMethods.cs
- XmlILOptimizerVisitor.cs
- DiagnosticsConfiguration.cs
- ClientRuntime.cs
- FigureParaClient.cs
- TimeSpanConverter.cs
- ContentDisposition.cs
- CopyNodeSetAction.cs
- SeverityFilter.cs
- LayoutEngine.cs
- BamlVersionHeader.cs
- JpegBitmapEncoder.cs
- DependencyObjectValidator.cs
- StrokeNodeOperations.cs
- RightsManagementUser.cs
- Size3D.cs
- ResizeGrip.cs
- SharedPersonalizationStateInfo.cs
- GridToolTip.cs
- DayRenderEvent.cs
- FileStream.cs
- ActionFrame.cs
- FontCacheLogic.cs
- CompositionTarget.cs
- LookupTables.cs
- CheckoutException.cs
- MethodBody.cs
- ElementUtil.cs
- ToolbarAUtomationPeer.cs
- TracedNativeMethods.cs
- IInstanceTable.cs
- SqlWebEventProvider.cs
- TableLayoutPanelCellPosition.cs
- DetailsViewRow.cs
- PlainXmlDeserializer.cs