Class CmsFileWriter
java.lang.Object
com.compomics.util.experiment.io.mass_spectrometry.cms.CmsFileWriter
- All Implemented Interfaces:
AutoCloseable
public class CmsFileWriter extends Object implements AutoCloseable
Writer for cms files.
- Author:
- Marc Vaudel, Harald Barsnes
-
Field Summary
Fields Modifier and Type Field Description static int
HEADER_LENGTH
The length of the file header. -
Constructor Summary
Constructors Constructor Description CmsFileWriter(File outputFile)
Constructor. -
Method Summary
Modifier and Type Method Description void
addSpectrum(String spectrumTitle, Spectrum spectrum)
Adds a spectrum to the file.void
close()
-
Field Details
-
HEADER_LENGTH
public static final int HEADER_LENGTHThe length of the file header.
-
-
Constructor Details
-
CmsFileWriter
Constructor.- Parameters:
outputFile
- the output file.- Throws:
FileNotFoundException
- Exception thrown if the output file was not found.IOException
- Exception thrown if an error occurred while attempting to write to output file.
-
-
Method Details
-
addSpectrum
Adds a spectrum to the file.- Parameters:
spectrumTitle
- The title of the spectrum to add.spectrum
- The spectrum to add.- Throws:
IOException
- Exception thrown if an error occurred while attempting to write to output file.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-