Compress and decompress the array