BizTalk Compressing / Decompressing Pipeline components

By patrickwellink
January 16, 2006
Comments Off on BizTalk Compressing / Decompressing Pipeline components

The new BizTalk 2006 samples are really GREAT.

There is lots of stuff in it really worth a look. One of the things i have been needing for a while was a Streaming ZIP component.
And I know with the components available out there it was possible to compress a stream. But it was not really possible to do that in a streaming fashion.

But not anymore, Visual studio 2005 has it’s own compression classes (I gues this is new) and one of them happens to be a CompressionStream. You can use this with ease in a pipeline component, to pass on the stream (but now compressed)

Could be really usefull in some situations…..

The sample is located at : C:Program FilesMicrosoft BizTalk Server 2006SDKScenariosPM in your BizTalk installation.

    using System.IO.Compression;
    using System.Collections.Generic;

    /// <summary>
    /// Implements a wrapper for System.IO.Stream class. In BizTalk server we always read from
    /// streams. GZipStream compresses data while writing. So we have encapsulated the incoming
    /// stream and GZipStream in our stream implmentation. We are providing compression while stream
    /// is being read.
    /// </summary>
    /// <remarks>
    /// CompressionStream derives from System.IO.Stream class to
    /// enable streaming processing of messages while compressing.
    /// </remarks>
    internal class CompressionStream : System.IO.Stream
        private Boolean _bStarted; //finished reading incoming stream
        private Stream _incomingStm; //Incoming stream that needs to be compressed
        private GZipStream _compressStm; //stream to compress data

Comments: 0

Comments are closed.

  • Recent Posts
  • Recent Comments
  • Archives
  • Categories
  • Meta