The tar.gz format was not designed for random access. It was intended for when the entire package would be unpacked at once. That allows the series of files to be compressed as a single stream, generally improving compression, especially for many small files. However if you try to pull out just one file from the middle somewhere, you will need to first decompress all the files up to that point.
For random access to individual files, you should consider repackaging using the zip format. The compression won't be as good, put you can pluck out individual files very quickly. In Java, look at the ZipFile class.