Package org.biojava3.core.util
Class InputStreamProvider
java.lang.Object
org.biojava3.core.util.InputStreamProvider
A class that provides an InputStream from a File. The file can be compressed or uncompressed.
Currently supported compressions:
- Gzip (extension .gz)
- Zip (extension .zip) in this case a stream to the first entry in the zip file is returned
- Jar (extension .jar) same as .Zip; only stream to first entry is returned
- Z (extension .Z) compressed using the unix compress command
- for any other extension, no compression is assumed
- Since:
- 1.5
- Version:
- %I% %G%
- Author:
- Andreas Prlic
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final int
The magic number found at the start of a GZIP stream. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget an InputStream for the filegetInputStream
(String pathToFile) get an InputStream for this file
-
Field Details
-
GZIP_MAGIC
public static final int GZIP_MAGICThe magic number found at the start of a GZIP stream.- See Also:
-
CACHE_PROPERTY
- See Also:
-
-
Constructor Details
-
InputStreamProvider
public InputStreamProvider()
-
-
Method Details
-
getInputStream
get an InputStream for this file- Parameters:
pathToFile
- the path of the file.- Returns:
- an InputStream for the file located at the path.
- Throws:
IOException
-
getInputStream
- Throws:
IOException
-
getInputStream
get an InputStream for the file- Parameters:
f
- a File- Returns:
- an InputStream for the file
- Throws:
IOException
-