B4A Library RandomAccessFile - V1.15 - Android gzip and zlib compressions

Status
Not open for further replies.
This update adds support for gzip and zlib compression. It allows you to wrap an input stream or output stream and then decompress data while reading or compress data while writing.
It also supports in-memory compression and decompression.

A full example is available in the manual: http://www.b4x.com/android/help/randomaccessfile.html#compressedstreams

Installation instructions:
- Unzip the attached file.
- Copy both files to the internal libraries folder: C:\Program Files\Anywhere Software\Basic4android\Libraries
 

Attachments

  • RandomAccessFile.zip
    18.7 KB · Views: 726

leitor79

Active Member
Licensed User
Longtime User
Hi!

Can multiple files be compressed into one gzip? How can I do it? I've tried several things, for exampel:

B4X:
out1=File.OpenOutput("",sFile,False)
out = File.Openoutput("", sc,  True)
out=compress.WrapoutputStream(out1,"gzip")
WriteStringToStream(out, s)

With that I get 0 byte file.

I've also tried OpenInput for the file to compress (it has more sense to me since I'm not writing there) but I got errors (wrapinputstream returns an inputstream, thing I don't get it because I need an outputstream to write the file, right?)

Thank you!


PS: gzip or any format would do it.
 
Last edited:
Status
Not open for further replies.
Top