private static void Compress(CompressOptions options) { var settings = new CompressSettings { ChunkSize = ConvertMegabytesToBytes(options), PoolSize = options.Poolsize }; IStrategy strategy = new CompressStrategy(settings); Work(strategy, options); }
/// <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; }
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)); }
/// <summary> /// Decompresses the Attachments that are part of this AS4 Message. /// </summary> public void DecompressAttachments() { CompressStrategy .ForAS4Message(this) .Decompress(); }