【IT168技术文档】
//Sourcecode from tomas_restrepo, a great BTS developer using System; using System.Collections.Generic; using System.IO; using System.Runtime.Serialization; using System.Text; using Microsoft.XLANGs.BaseTypes; using Microsoft.XLANGs.RuntimeTypes; using Microsoft.XLANGs.Core; namespace Winterdom.BizTalk.Samples.BinaryHelper { public class BinaryStreamFactory : RefCountedBase, IRefCountedStreamFactory { private Stream _stream; public BinaryStreamFactory(Stream stream) { if ( stream == null ) throw new ArgumentNullException("stream"); if ( stream.Position != 0 ) { stream.Position = 0; } _stream = stream; } public Stream CreateStream() { return _stream; } public override void Dispose() { _stream.Dispose(); } } }