|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.chromatogram.ChromatogramFactory
public class ChromatogramFactory
A factory that creates Chromatogram
objects from files or streams.
In either case, the type of object to create is determined from the first
four bytes of the stream (the magic number).
Field Summary | |
---|---|
static int |
ABI_MAGIC
The magic number for ABIF files. |
static int |
SCF_MAGIC
The magic number for SCF files. |
Constructor Summary | |
---|---|
ChromatogramFactory()
|
Method Summary | |
---|---|
static Chromatogram |
create(java.io.File f)
Creates a new Chromatogram object from the named file. |
static Chromatogram |
create(java.io.InputStream in)
Creates a new Chromatogram object from the supplied stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SCF_MAGIC
public static final int ABI_MAGIC
Constructor Detail |
---|
public ChromatogramFactory()
Method Detail |
---|
public static Chromatogram create(java.io.File f) throws java.io.IOException, UnsupportedChromatogramFormatException
Chromatogram
object from the named file.
f
- the file to read
java.io.IOException
- when the file can't be read or some other I/O error occurs
UnsupportedChromatogramFormatException
- when the file doesn't
contain a chromatogram in a supported formatpublic static Chromatogram create(java.io.InputStream in) throws java.io.IOException, UnsupportedChromatogramFormatException
Chromatogram
object from the supplied stream.
Note that for some chromatogram formats, this can be much more
memory-intensive than reading from a file.
Note also that if the provided stream is a
CachingInputStream
, it will be seeked
back to 0 before being passed to the parser. This is because the
parsers that use CachingInputStream
assume that the
"file" starts at 0.
in
- the stream from which to read the chromatogram.
java.io.IOException
- when there's a problem with the stream
UnsupportedChromatogramFormatException
- when the file doesn't
contain a chromatogram in a supported format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |