Class NexusFileFormat


  • public class NexusFileFormat
    extends Object
    Reads/writes Nexus files and fires events at a NexusFileListener object. Blocks are parsed using NexusBlockParser objects provided at runtime. Each of those objects should probably have a NexusBlockListener object associated with them that receives events generated from the processed data in the block.
    Since:
    1.6
    Author:
    Richard Holland, Tobias Thierer, Jim Balhoff
    • Method Detail

      • writeFile

        public static void writeFile​(File file,
                                     NexusFile nexusFile)
                              throws IOException
        Writes the given Nexus output to a file.
        Parameters:
        file - the file to write to.
        nexusFile - the Nexus output to write.
        Throws:
        IOException - if there is a problem during writing.
      • writeStream

        public static void writeStream​(OutputStream os,
                                       NexusFile nexusFile)
                                throws IOException
        Writes the given Nexus output to a stream.
        Parameters:
        os - the stream to write to.
        nexusFile - the Nexus output to write.
        Throws:
        IOException - if there is a problem during writing.
      • writeWriter

        public static void writeWriter​(Writer writer,
                                       NexusFile nexusFile)
                                throws IOException
        Writes the given Nexus output to a writer.
        Parameters:
        writer - the writer to write to.
        nexusFile - the Nexus output to write.
        Throws:
        IOException - if there is a problem during writing.