コード例 #1
0
        private static void Compress(CompressOptions options)
        {
            var settings = new CompressSettings {
                ChunkSize = ConvertMegabytesToBytes(options), PoolSize = options.Poolsize
            };
            IStrategy strategy = new CompressStrategy(settings);

            Work(strategy, options);
        }
コード例 #2
0
        /// <summary>
        /// Compresses the Attachments that are part of this AS4 Message and
        /// modifies the Payload-info in the UserMessage to indicate that the attachment
        /// is compressed.
        /// </summary>
        public void CompressAttachments()
        {
            CompressStrategy
            .ForAS4Message(this)
            .Compress();

            // Since the headers in the message have changed, the EnvelopeDocument
            // is no longer in sync and should be set to null.
            EnvelopeDocument = null;
        }
コード例 #3
0
        public void EndToEnd()
        {
            File.WriteAllText(_source, "Lorem!");
            var compres = new CompressStrategy(new CompressSettings()
            {
                ChunkSize = 1024, PoolSize = 1
            });

            compres.Work(_source, _compressed);
            var decompress = new DecompressStrategy(1);

            decompress.Work(_compressed, _decompressed);
            CollectionAssert.AreEqual(File.ReadAllBytes(_source), File.ReadAllBytes(_decompressed));
        }
コード例 #4
0
 /// <summary>
 /// Decompresses the Attachments that are part of this AS4 Message.
 /// </summary>
 public void DecompressAttachments()
 {
     CompressStrategy
     .ForAS4Message(this)
     .Decompress();
 }