Read and write compressed data