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