Similar to extract-offsets-from-redis-bitmap repository, I just transfer it to java