private int scanFormat(InputStream is) {
        int format = this.FORMAT;
        int maxsize = 524288;     //  512K

        byte[] buf = new byte[maxsize];
        try {
            if (is.markSupported()) {
                is.mark(maxsize);
            }
            int msgsize = is.read(buf);                // read in at least the full data

            String message = (new String(buf, UTF_8)).toLowerCase(Locale.ROOT);
            // these are not if-then-else, because we want to go from most common
            // and fall through to least.  this is imperfect, as these tags could
            // show up in other agency stories, but i can't find a spec or any
            // explicit codes to identify the wire source in the message itself

            if (message.contains("ap-wf")) {
                format = this.FMT_IPTC_AP;
            }
            if (message.contains("reuters")) {
                format = this.FMT_IPTC_RTR;
            }
            if (message.contains("new york times")) {
                format = this.FMT_IPTC_NYT;
            }
            if (message.contains("bloomberg news")) {
                format = this.FMT_IPTC_BLM;
            }
        } catch (IOException eio) {
            // we are in an unstable state
        }

        try {
            if (is.markSupported()) {
                is.reset();
            }
        } catch (IOException eio) {
            // we are in an unstable state
        }
        return (format);
    }
scan the news messsage and store the metadata and data into a map
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-news-module/src/main/java/org/apache/tika/parser/iptc/IptcAnpaParser.java