test_class.declarator: factory = new ReaderFactory()
test_class.modifier: private
test_class.original_string: private ReaderFactory factory = new ReaderFactory();
test_class.type: ReaderFactory
test_class.var_name: factory
test_class.file: storage/io/src/test/java/org/openscience/cdk/io/ReaderFactoryTest.java
test_class.identifier: ReaderFactoryTest
test_class.superclass: extends AbstractReaderFactoryTest
test_case.body: @Test
      public void testCreateReader_IChemFormat() {
          IChemFormat format = (IChemFormat) XYZFormat.getInstance();
          ISimpleChemObjectReader reader = factory.createReader(format);
          Assert.assertNotNull(reader);
          Assert.assertEquals(format.getFormatName(), reader.getFormat().getFormatName());
      }
test_case.class_method_signature: ReaderFactoryTest.testCreateReader_IChemFormat()
test_case.full_signature: @Test public void testCreateReader_IChemFormat()
test_case.identifier: testCreateReader_IChemFormat
test_case.invocations: getInstance createReader assertNotNull assertEquals getFormatName getFormatName getFormat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateReader_IChemFormat()
focal_class.declarator: logger        = LoggingToolFactory.createLoggingTool(ReaderFactory.class)
focal_class.modifier: private static
focal_class.original_string: private static ILoggingTool logger        = LoggingToolFactory.createLoggingTool(ReaderFactory.class);
focal_class.type: ILoggingTool
focal_class.var_name: logger
focal_class.declarator: formatFactory = null
focal_class.modifier: private
focal_class.original_string: private FormatFactory       formatFactory = null;
focal_class.type: FormatFactory
focal_class.var_name: formatFactory
focal_class.declarator: headerLength  = 8192
focal_class.modifier: private
focal_class.original_string: private int                 headerLength  = 8192;
focal_class.type: int
focal_class.var_name: headerLength
focal_class.file: storage/io/src/main/java/org/openscience/cdk/io/ReaderFactory.java
focal_class.identifier: ReaderFactory
focal_class.class_method_signature: ReaderFactory.ReaderFactory()
focal_class.full_signature: public  ReaderFactory()
focal_class.identifier: ReaderFactory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ReaderFactory()
focal_class.class_method_signature: ReaderFactory.ReaderFactory(int headerLength)
focal_class.full_signature: public  ReaderFactory(int headerLength)
focal_class.identifier: ReaderFactory
focal_class.modifiers: public
focal_class.parameters: (int headerLength)
focal_class.signature:  ReaderFactory(int headerLength)
focal_class.class_method_signature: ReaderFactory.registerFormat(IChemFormatMatcher format)
focal_class.full_signature: public void registerFormat(IChemFormatMatcher format)
focal_class.identifier: registerFormat
focal_class.modifiers: public
focal_class.parameters: (IChemFormatMatcher format)
focal_class.return: void
focal_class.signature: void registerFormat(IChemFormatMatcher format)
focal_class.class_method_signature: ReaderFactory.getFormats()
focal_class.full_signature: public List<IChemFormatMatcher> getFormats()
focal_class.identifier: getFormats
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<IChemFormatMatcher>
focal_class.signature: List<IChemFormatMatcher> getFormats()
focal_class.class_method_signature: ReaderFactory.createReader(InputStream input)
focal_class.full_signature: public ISimpleChemObjectReader createReader(InputStream input)
focal_class.identifier: createReader
focal_class.modifiers: public
focal_class.parameters: (InputStream input)
focal_class.return: ISimpleChemObjectReader
focal_class.signature: ISimpleChemObjectReader createReader(InputStream input)
focal_class.class_method_signature: ReaderFactory.createReader(IChemFormat format)
focal_class.full_signature: public ISimpleChemObjectReader createReader(IChemFormat format)
focal_class.identifier: createReader
focal_class.modifiers: public
focal_class.parameters: (IChemFormat format)
focal_class.return: ISimpleChemObjectReader
focal_class.signature: ISimpleChemObjectReader createReader(IChemFormat format)
focal_class.class_method_signature: ReaderFactory.createReader(Reader input)
focal_class.full_signature: public ISimpleChemObjectReader createReader(Reader input)
focal_class.identifier: createReader
focal_class.modifiers: public
focal_class.parameters: (Reader input)
focal_class.return: ISimpleChemObjectReader
focal_class.signature: ISimpleChemObjectReader createReader(Reader input)
focal_method.body: public ISimpleChemObjectReader createReader(InputStream input) throws IOException {
          IChemFormat format = null;
          ISimpleChemObjectReader reader = null;
          if (input instanceof GZIPInputStream) {
              format = formatFactory.guessFormat(input);
              reader = createReader(format);
              if (reader != null) {
                  try {
                      reader.setReader(input);
                  } catch (CDKException e1) {
                      IOException wrapper = new IOException("Exception while setting the InputStream: " + e1.getMessage());
                      wrapper.initCause(e1);
                      throw wrapper;
                  }
              }
          } else {
              BufferedInputStream bistream = new BufferedInputStream(input, headerLength);
              InputStream istreamToRead = bistream; // if gzip test fails, then take default
              bistream.mark(5);
              int countRead = 0;
              byte[] abMagic = new byte[4];
              countRead = bistream.read(abMagic, 0, 4);
              bistream.reset();
              if (countRead == 4) {
                  if (abMagic[0] == (byte) 0x1F && abMagic[1] == (byte) 0x8B) {
                      istreamToRead = new BufferedInputStream(new GZIPInputStream(bistream));
                  }
              }
              format = formatFactory.guessFormat(istreamToRead);
              reader = createReader(format);
              if (reader != null) {
                  try {
                      reader.setReader(istreamToRead);
                  } catch (CDKException e1) {
                      IOException wrapper = new IOException("Exception while setting the InputStream: " + e1.getMessage());
                      wrapper.initCause(e1);
                      throw wrapper;
                  }
              }
          }
          return reader;
      }
focal_method.class_method_signature: ReaderFactory.createReader(InputStream input)
focal_method.full_signature: public ISimpleChemObjectReader createReader(InputStream input)
focal_method.identifier: createReader
focal_method.invocations: guessFormat createReader setReader getMessage initCause mark read reset guessFormat createReader setReader getMessage initCause
focal_method.modifiers: public
focal_method.parameters: (InputStream input)
focal_method.return: ISimpleChemObjectReader
focal_method.signature: ISimpleChemObjectReader createReader(InputStream input)