public class ChromatogramFactory extends Object
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).Modifier and Type | Field and Description |
---|---|
static int |
ABI_MAGIC
The magic number for ABIF files.
|
static int |
SCF_MAGIC
The magic number for SCF files.
|
Constructor and Description |
---|
ChromatogramFactory() |
Modifier and Type | Method and Description |
---|---|
static Chromatogram |
create(File f)
Creates a new
Chromatogram object from the named file. |
static Chromatogram |
create(InputStream in)
Creates a new
Chromatogram object from the supplied stream. |
public static final int SCF_MAGIC
public static final int ABI_MAGIC
public ChromatogramFactory()
public static Chromatogram create(File f) throws IOException, UnsupportedChromatogramFormatException
Chromatogram
object from the named file.f
- the file to readIOException
- when the file can't be read or some other I/O error occursUnsupportedChromatogramFormatException
- when the file doesn't
contain a chromatogram in a supported formatpublic static Chromatogram create(InputStream in) throws 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.IOException
- when there's a problem with the streamUnsupportedChromatogramFormatException
- when the file doesn't
contain a chromatogram in a supported formatCopyright © 2014 BioJava. All rights reserved.