Here you can find the source of getInputStream(File f)
Parameter | Description |
---|---|
f | File |
Parameter | Description |
---|---|
FileNotFoundException | When the file's not found |
private static InputStream getInputStream(File f) throws FileNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.zip.GZIPInputStream; public class Main { /**// w w w . ja v a2 s .c om * Gets the input stream for a given file (for tar archives) * * @param f * File * * @return InputStream * * @throws FileNotFoundException * When the file's not found */ private static InputStream getInputStream(File f) throws FileNotFoundException { InputStream is = new FileInputStream(f); try { return new GZIPInputStream(is); } catch (IOException e) { return new FileInputStream(f); } } }