code: 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;
      }
docs: Detects the format of the Reader input, and if known, it will return
  a CDK Reader to read the format, or null when the reader is not
  implemented.
  
  @return null if CDK does not contain a reader for the detected format.
  
  @see #createReader(Reader)