Skip to content
Snippets Groups Projects
Commit 867dfd2c authored by langella's avatar langella
Browse files

OutputStreamWriter added... my fault

git-svn-id: https://subversion.renater.fr/xtandempipeline/trunk@276 b8ef2a07-7df7-436f-90b9-41648038564b
parent 02321c2a
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@ package fr.inra.pappso.xtandempipeline.sax_parse;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamWriter;
......@@ -35,12 +37,14 @@ import fr.inra.pappso.xtandempipeline.class_msms.Identification;
import fr.inra.pappso.xtandempipeline.class_msms.ModifsList;
public class MassChroQmlOutput {
private static final Logger logger = Logger.getLogger(MassChroQmlOutput.class);
private static final Logger logger = Logger
.getLogger(MassChroQmlOutput.class);
ModifsList isotopic_mods;
Identification ident;
public MassChroQmlOutput(ModifsList isotopic_mods, Identification ident) throws ProticPortException {
public MassChroQmlOutput(ModifsList isotopic_mods, Identification ident)
throws ProticPortException {
this.isotopic_mods = isotopic_mods;
this.ident = ident;
......@@ -49,13 +53,19 @@ public class MassChroQmlOutput {
public void write(OutputStream outputStream) {
try {
XMLOutputFactory factory = XMLOutputFactory.newInstance();
//OutputStreamWriter noIndentOutput = new OutputStreamWriter(
// outputStream, "UTF8");
//XMLStreamWriter writer = factory.createXMLStreamWriter(noIndentOutput);
XMLStreamWriter writer = new IndentingXMLStreamWriter(factory.createXMLStreamWriter(outputStream));
// OutputStreamWriter noIndentOutput = new OutputStreamWriter(
// outputStream, "UTF8");
// XMLStreamWriter writer =
// factory.createXMLStreamWriter(noIndentOutput);
OutputStreamWriter output = new OutputStreamWriter(outputStream,
"UTF8");
XMLStreamWriter writer = new IndentingXMLStreamWriter(
factory.createXMLStreamWriter(output));
writer.writeStartDocument("UTF-8", "1.0");
MassChroQmlWriter masschroq_ml_writer = new MassChroQmlWriter(writer);
MassChroQmlWriter masschroq_ml_writer = new MassChroQmlWriter(
writer);
masschroq_ml_writer.write(this.isotopic_mods, this.ident);
writer.writeEndDocument();
......@@ -70,7 +80,8 @@ public class MassChroQmlOutput {
} catch (IOException e1) {
logger.debug("ERROR : " + e.getMessage(), e);
}
// throw new ProticPortException ("ERROR writing mzXml "+ e.getMessage());
// throw new ProticPortException ("ERROR writing mzXml "+
// e.getMessage());
logger.debug("ERROR writing MassChroQml : " + e.getMessage(), e);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment