Does anyone know how one can compress a bytearray (byte[]) in java using gzip then uncompress it in AS3 and vice-versa?
Please provide example code or links to exampls
Printable View
Does anyone know how one can compress a bytearray (byte[]) in java using gzip then uncompress it in AS3 and vice-versa?
Please provide example code or links to exampls
Hi,
on the flash side the byte array supports zlib compression, so you should probably look for zlib on the java side as well
If the bytearray is completely compressed, as3 is just
If you have compressed and uncompressed portions (like a swf file with 8 bytes header), you would copy the compressed part to a new bytearray first. This is part of an swf readerCode:bytes.uncompress()
MusicmanCode:bytes.position = 8;
var newbytes:ByteArray = new ByteArray();
bytes.readBytes(newbytes, 0, bytes.length-bytes.position);
newbytes.uncompress();
newbytes.position = 0;