use a buffer for archiving and unarchiving.
added support for gzip compression and decompression.
improved the code of using zlib.