Q:

Accessing Java files within .tar files using Java

I am creating a Java application that will take in .tar files and retrieve all the files from these .tar files. I know you can use GZIPInputStream to get the files from the .tar files, but is it possible to get these files from the GZIPInputStream as a FileInputStream, something like below?
InputStream is = new GZIPInputStream(new FileInputStream(file)); 

A:

Yes, it is possible due to the CTOR of GZipInputStream that lets you accept an InputStream as parameter (GZipInputStream is a wrapper in that sense to InputStream). Then all you need to do is follow examples you can find on the internet such as this in order to extract the files.

