org.biojava.utils.io
Class InputStreamProvider

java.lang.Object
  extended by org.biojava.utils.io.InputStreamProvider

public class InputStreamProvider
extends java.lang.Object

A class that provides an InputStream from a File. The file can be compressed or uncompressed. Currently supported compressions:

Since:
1.5
Version:
%I% %G%
Author:
Andreas Prlic

Field Summary
static int GZIP_MAGIC
          The magic number found at the start of a GZIP stream.
 
Constructor Summary
InputStreamProvider()
           
 
Method Summary
 java.io.InputStream getInputStream(java.io.File f)
          get an InputStream for the file
 java.io.InputStream getInputStream(java.lang.String pathToFile)
          get an InputStream for this file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GZIP_MAGIC

public static final int GZIP_MAGIC
The magic number found at the start of a GZIP stream.

See Also:
Constant Field Values
Constructor Detail

InputStreamProvider

public InputStreamProvider()
Method Detail

getInputStream

public java.io.InputStream getInputStream(java.lang.String pathToFile)
                                   throws java.io.IOException
get an InputStream for this file

Parameters:
pathToFile - the path of the file.
Returns:
an InputStream for the file located at the path.
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream(java.io.File f)
                                   throws java.io.IOException
get an InputStream for the file

Parameters:
f - a File
Returns:
an InputStream for the file
Throws:
java.io.IOException