import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
public void toNexus( final File out_file, final Phylogeny tree, final NH_CONVERSION_SUPPORT_VALUE_STYLE svs )
throws IOException {
- final Writer writer = new BufferedWriter( new PrintWriter( out_file ) );
+ final Writer writer = new BufferedWriter( new PrintWriter( out_file, ForesterConstants.UTF_8 ) );
final List<Phylogeny> trees = new ArrayList<Phylogeny>( 1 );
trees.add( tree );
writeNexusStart( writer );
final List<Phylogeny> trees,
final int phyloxml_level,
final String separator ) throws IOException {
- final Writer writer = new BufferedWriter( new PrintWriter( out_file ) );
+ final Writer writer = new BufferedWriter( new PrintWriter( out_file, ForesterConstants.UTF_8 ) );
toPhyloXML( writer, trees, phyloxml_level, separator );
writer.flush();
writer.close();
}
public void toPhyloXML( final File out_file, final Phylogeny tree, final int phyloxml_level ) throws IOException {
- final Writer writer = new BufferedWriter( new PrintWriter( out_file ) );
+ final Writer writer = new BufferedWriter( new PrintWriter( out_file, ForesterConstants.UTF_8 ) );
writePhyloXmlStart( writer );
toPhyloXMLNoPhyloXmlSource( writer, tree, phyloxml_level );
writePhyloXmlEnd( writer );
if ( out_file.exists() ) {
throw new IOException( "attempt to overwrite existing file \"" + out_file.getAbsolutePath() + "\"" );
}
- final PrintWriter out = new PrintWriter( new FileWriter( out_file ), true );
- if ( getOutputFormt() == FORMAT.PHYLO_XML ) {
- out.print( PHYLO_XML_VERSION_ENCODING_LINE );
- out.print( ForesterUtil.LINE_SEPARATOR );
- out.print( PHYLO_XML_NAMESPACE_LINE );
- out.print( ForesterUtil.LINE_SEPARATOR );
- }
+ final PrintWriter out = new PrintWriter( out_file, ForesterConstants.UTF_8 );
out.print( sb );
- if ( getOutputFormt() == FORMAT.PHYLO_XML ) {
- out.print( ForesterUtil.LINE_SEPARATOR );
- out.print( PHYLO_XML_END );
- }
out.flush();
out.close();
}
NH, NHX, PHYLO_XML, NEXUS;
}
}
+
+
+
+