docs: public static InputStream tryGzipInput(InputStream in) throws IOException {
      // try autodetecting gzip compression.
      if(!in.markSupported()) {
        PushbackInputStream pb = new PushbackInputStream(in, 16);
        // read a magic from the file header, and push it back
        byte[] magic = { 0, 0 };
        int r = pb.read(magic);
        pb.unread(magic, 0, r);
        return (magic[0] == 31 && magic[1] == -117) ? new GZIPInputStream(pb) : pb;
      }
      // Mark is supported.
      in.mark(16);
      boolean isgzip = ((in.read() << 8) | in.read()) == GZIPInputStream.GZIP_MAGIC;
      in.reset(); // Rewind
      return isgzip ? new GZIPInputStream(in) : in;
    }