class GZIPAnalyzer extends FileAnalyzer {

    private static final Logger LOGGER = LoggerFactory.getLogger(GZIPAnalyzer.class);

    private Genre g;

    @Override
    public Genre getGenre() {
        if (g != null) {
            return g;
        }
        return super.getGenre();
    }

    protected GZIPAnalyzer(AnalyzerFactory factory) {
        super(factory);
    }

    /**
     * @return {@code null} as there is no aligned language
     */
    @Override
    public String getCtagsLang() {
        return null;
    }

    /**
     * Gets a version number to be used to tag processed documents so that
     * re-analysis can be re-done later if a stored version number is different
     * from the current implementation.
     * @return 20180111_00
     */
    @Override
    protected int getSpecializedVersionNo() {
        return 20180111_00; // Edit comment above too!
    }

    @Override
    public void analyze(Document doc, StreamSource src, Writer xrefOut)
            throws IOException, InterruptedException {<FILL_FUNCTION_BODY>}

    /**
     * Wrap the raw stream source in one that returns the uncompressed stream.
     */
    private static StreamSource wrap(final StreamSource src) {
        return new StreamSource() {
            @Override
            public InputStream getStream() throws IOException {
                return new BufferedInputStream(
                        new GZIPInputStream(src.getStream()));
            }
        };
    }
}

        AbstractAnalyzer fa;

        StreamSource gzSrc = wrap(src);
        String path = doc.get(QueryBuilder.PATH);
        if (path != null && path.toLowerCase(Locale.ROOT).endsWith(".gz")) {
            String newname = path.substring(0, path.length() - 3);
            try (InputStream gzis = gzSrc.getStream()) {
                fa = AnalyzerGuru.getAnalyzer(gzis, newname);
            }
            if (fa == null) {
                this.g = Genre.DATA;
                LOGGER.log(Level.WARNING, "Did not analyze {0}, detected as data.", newname);
                //TODO we could probably wrap tar analyzer here, need to do research on reader coming from gzis ...
            } else { // cant recurse!
                //simple file gziped case captured here
                if (fa.getGenre() == Genre.PLAIN || fa.getGenre() == Genre.XREFABLE) {
                    this.g = Genre.XREFABLE;
                } else {
                    this.g = Genre.DATA;
                }
                fa.analyze(doc, gzSrc, xrefOut);
                if (doc.get(QueryBuilder.T) != null) {
                    doc.removeField(QueryBuilder.T);
                    if (g == Genre.XREFABLE) {
                        doc.add(new Field(QueryBuilder.T, g.typeName(),
                                AnalyzerGuru.string_ft_stored_nanalyzed_norms));
                    }
                }

            }
        }
    
<methods>public void <init>(org.opengrok.indexer.analysis.AnalyzerFactory) ,public void analyze(Document, org.opengrok.indexer.analysis.StreamSource, java.io.Writer) throws java.io.IOException, java.lang.InterruptedException,public java.lang.String getCtagsLang() ,public java.lang.String getFileTypeName() ,public final long getVersionNo() ,public org.opengrok.indexer.analysis.Xrefer writeXref(org.opengrok.indexer.analysis.WriteXrefArgs) throws java.io.IOException<variables>private static final java.util.logging.Logger LOGGER