Change the API to compress and uncompress in place instead of allocating new arrays every time.