ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

GZip Support

Open LutzRose opened this issue 7 years ago • 13 comments

With the C/AL Open Library there was a GZip support. In version 15 there is no corresponding module?

LutzRose avatar Sep 09 '19 07:09 LutzRose

What is the status? We need GZip support too for our products.

megel avatar Oct 16 '19 14:10 megel

Gzip support is needed for app source readiness in our product.

Diessner avatar Oct 18 '19 12:10 Diessner

@JesperSchulz

AlexanderYakunin avatar Nov 08 '19 11:11 AlexanderYakunin

We need Gzip support as well to increase web service performance.

johalbert avatar Nov 12 '19 13:11 johalbert

@JesperSchulz any progress for this request?

megel avatar Nov 12 '19 18:11 megel

Please allow me to forward your issue to the engineers, who made the Data Compression module. They will get back to you asap!

JesperSchulz avatar Nov 13 '19 09:11 JesperSchulz

And sorry about the delayed response. I had set up a too restrictive mail rule which ate all of my notifications :-(

JesperSchulz avatar Nov 13 '19 09:11 JesperSchulz

If you want to open a GZip archive stream and read its entries, you can do so by: DataCompression.OpenZipArchive(GzipInStream, false); If you want to create an archive in Gzip format - we don't support that in Data Compression module. Please keep in mind that we never had a wrapper for GZipStream .NET class in BaseApp - we use GZipStream .NET class directly in a few places in BaseApp.

If you would like to get the ability of compressing a stream by using GZip compression with Data Compression module, please log an idea on our ideas forum https://aka.ms/BusinessCentralideas

dcenic avatar Nov 13 '19 09:11 dcenic

Actually, we do have a .NET wrapper as well: Codeunit 3036 DotNet_GzipStream. It will also allow you to do a few things with GZip! And instead of creating an Idea (which may take time to get accepted and implemented), you are more than welcome to create a pull request right in this repo and add the functionality to the Data Compression module you are missing! We will process those PRs as quickly as we can.

JesperSchulz avatar Nov 13 '19 10:11 JesperSchulz

The wrapper DotNet_GzipStream would be perfect, I used that one together with DotNet_CompressionMode to decompress Gzip streams in BC14. But in BC15 I can't find either of those .NET wrappers. Am I missing something?

DataCompression.OpenZipArchive(GzipInStream, false) unfortunately throws an error when it's used with Gzip Streams: grafik This makes kind of sense I guess (?) since Gzip files lack the EOCD signature.

haweg avatar Nov 13 '19 17:11 haweg

That is odd! That wrapper should only have been removed, if the new module fulfills the requirements which the wrapper fulfilled. That is an honest mistake. I will create a bug right away to address the shortcomings! Our apologies!

And again, if you need even more functionality, please don't hesitate to contribute to the module! We'd be happy to bring in your code to make the module more capable.

JesperSchulz avatar Nov 14 '19 08:11 JesperSchulz

The fix is checked in and will be available in the next minor release of Business Central 15. Data Compression will have these methods: DataCompression.GZipCompress(InputStream: InStream; CompressedStream: OutStream); DataCompression.GZipDecompress(InputStream: InStream; DecompressedStream: OutStream); DataCompression.IsGZip(InputStream: InStream): Boolean;

dcenic avatar Nov 22 '19 07:11 dcenic

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.

bc-ghost avatar Nov 25 '19 09:11 bc-ghost