uk.ac.sanger.npg.illumina.file.reader
Class IlluminaFileReader
java.lang.Object
uk.ac.sanger.npg.illumina.file.reader.IlluminaFileReader
- All Implemented Interfaces:
- java.io.Closeable, java.util.Iterator<java.lang.Object>
- Direct Known Subclasses:
- BCLFileReader, FilterFileReader, PositionFileReader, SCLFileReader
public class IlluminaFileReader
- extends java.lang.Object
- implements java.util.Iterator<java.lang.Object>, java.io.Closeable
This class tries to open a Illumina file into a data input stream.
It is a base class for all file reader classes.
Field Summary |
protected java.lang.String |
fileName
|
protected java.io.DataInputStream |
inputStream
|
Method Summary |
void |
close()
close file input stream |
java.lang.String |
getFileName()
|
boolean |
hasNext()
|
java.lang.Object |
next()
|
int |
readFourBytes()
read four bytes from its input stream and convert to unsigned integer |
int |
readFourBytes(java.io.DataInputStream inputStream)
read four bytes from an input stream and convert to unsigned integer |
void |
remove()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fileName
protected final java.lang.String fileName
inputStream
protected java.io.DataInputStream inputStream
IlluminaFileReader
public IlluminaFileReader(java.lang.String fileName)
throws java.io.FileNotFoundException
- Parameters:
fileName
- bcl, scl, clocs, locs, pos and filter etc Illumina file name
- Throws:
java.io.FileNotFoundException
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator<java.lang.Object>
next
public java.lang.Object next()
- Specified by:
next
in interface java.util.Iterator<java.lang.Object>
remove
public void remove()
- Specified by:
remove
in interface java.util.Iterator<java.lang.Object>
close
public void close()
- close file input stream
- Specified by:
close
in interface java.io.Closeable
readFourBytes
public int readFourBytes()
throws java.io.IOException
- read four bytes from its input stream and convert to unsigned integer
- Returns:
- an unsigned integer
- Throws:
java.io.IOException
readFourBytes
public int readFourBytes(java.io.DataInputStream inputStream)
throws java.io.IOException
- read four bytes from an input stream and convert to unsigned integer
- Parameters:
inputStream
-
- Returns:
- an unsigned integer
- Throws:
java.io.IOException
getFileName
public java.lang.String getFileName()
- Returns:
- the fileName