Android Question Sending Big Json String - Using CompressedStreams

virpalacios

Active Member
Licensed User
Longtime User
Hi All, Hope you are doing fine, thanks for any comments about this issue

I the past, I was able to get a compress json from a php script, in BA4 I have to use:
Uncompressing json in B4A:
             json_descomprimido = descompresor_gs.DecompressBytes(Bit.InputStreamToBytes(job.GetInputStream),"zlib")
            resultstring = BytesToString(json_descomprimido,0, json_descomprimido.Length, "UTF8")


Now I have to do an inverse process, I have to compress a Big Json String in B4A and sending it to a php script
I am planning using CompressBytes(Data() as Byte, CompressMethod() as String) as Byte() in the php script I want to use gzuncompress.
My Doubts are:
a) Do I have to convert my json string to a Bytes Array before use CompressBytes?
b) If so after getting compressed Byte() array , do I have to convert it to a inputstream or another format before sending to php script?

Thanks in Advance!!! Best Regards
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…