re-implementation of zlib in pure Java