code implementation for compressed data client and server