Class ReaderFactory


  • public class ReaderFactory
    extends Object
    A factory for creating ChemObjectReaders. The type of reader created is determined from the content of the input. Formats of GZiped files can be detected too. A typical example is:
    
       StringReader stringReader = "<molecule/>";
       ChemObjectReader reader = new ReaderFactory().createReader(stringReader);
     
    Author:
    Egon Willighagen <egonw@sci.kun.nl>, Bradley A. Smith <bradley@baysmith.com>
    Source code:
    main
    Belongs to CDK module:
    io
    • Constructor Detail

      • ReaderFactory

        public ReaderFactory()
        Constructs a ReaderFactory which tries to detect the format in the first 65536 chars.
      • ReaderFactory

        public ReaderFactory​(int headerLength)
        Constructs a ReaderFactory which tries to detect the format in the first given number of chars.
        Parameters:
        headerLength - length of the header in number of chars