public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context)
            throws IOException, TikaException, SAXException {

        configure(context);
        DWGParserConfig dwgc = context.get(DWGParserConfig.class);

        if (!dwgc.getDwgReadExecutable().isEmpty()) {
            DWGReadParser dwr = new DWGReadParser();
            dwr.parse(stream, handler, metadata, context);
        } else {
            // First up, which version of the format are we handling?
            byte[] header = new byte[128];
            IOUtils.readFully(stream, header);
            String version = new String(header, 0, 6, "US-ASCII");

            XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
            xhtml.startDocument();

            switch (version) {
                case "AC1015":
                    metadata.set(Metadata.CONTENT_TYPE, TYPE.toString());
                    if (skipTo2000PropertyInfoSection(stream, header)) {
                        get2000Props(stream, metadata, xhtml);
                    }
                    break;
                case "AC1018":
                    metadata.set(Metadata.CONTENT_TYPE, TYPE.toString());
                    if (skipToPropertyInfoSection(stream, header)) {
                        get2004Props(stream, metadata, xhtml);
                    }
                    break;
                case "AC1027":
                case "AC1032":
                case "AC1021":
                case "AC1024":
                    metadata.set(Metadata.CONTENT_TYPE, TYPE.toString());
                    if (skipToPropertyInfoSection(stream, header)) {
                        get2007and2010Props(stream, metadata, xhtml);
                    }
                    break;
                default:
                    throw new TikaException("Unsupported AutoCAD drawing version: " + version);
            }

            xhtml.endDocument();
        }
    }
The value of padding bytes other than 0 in some DWG files.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-cad-module/src/main/java/org/apache/tika/parser/dwg/DWGParser.java