Re-implementation of zlib in pure Java