private int skipToCustomProperties(InputStream stream) throws IOException, TikaException {
        // There should be 4 zero bytes or CUSTOM_PROPERTIES_ALT_PADDING_VALUES next
        byte[] padding = new byte[4];
        IOUtils.readFully(stream, padding);
        if ((padding[0] == 0 && padding[1] == 0 && padding[2] == 0 && padding[3] == 0)
                || (padding[0] == CUSTOM_PROPERTIES_ALT_PADDING_VALUES[0]
                        && padding[1] == CUSTOM_PROPERTIES_ALT_PADDING_VALUES[1]
                        && padding[2] == CUSTOM_PROPERTIES_ALT_PADDING_VALUES[2]
                        && padding[3] == CUSTOM_PROPERTIES_ALT_PADDING_VALUES[3])) {

            // Looks hopeful, skip on
            padding = new byte[CUSTOM_PROPERTIES_SKIP];
            IOUtils.readFully(stream, padding);

            // We should now have the count
            int count = EndianUtils.readUShortLE(stream);

            // Plausibilitu check it
            if (count > 0 && count < 0x7f) {
                // Looks plausible
                return count;
            } else {
                // No properties / count is too high to trust
                return 0;
            }
        } else {
            // No padding. That probably means no custom props
            return 0;
        }
    }
We think it can be anywhere...
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-cad-module/src/main/java/org/apache/tika/parser/dwg/DWGParser.java