private XbmParseResult parseXbmHeader(final ByteSource byteSource) throws ImagingException, IOException {
        try (InputStream is = byteSource.getInputStream()) {
            final Map<String, String> defines = new HashMap<>();
            final ByteArrayOutputStream preprocessedFile = BasicCParser.preprocess(is, null, defines);
            int width = -1;
            int height = -1;
            int xHot = -1;
            int yHot = -1;
            for (final Entry<String, String> entry : defines.entrySet()) {
                final String name = entry.getKey();
                if (name.endsWith("_width")) {
                    width = parseCIntegerLiteral(entry.getValue());
                } else if (name.endsWith("_height")) {
                    height = parseCIntegerLiteral(entry.getValue());
                } else if (name.endsWith("_x_hot")) {
                    xHot = parseCIntegerLiteral(entry.getValue());
                } else if (name.endsWith("_y_hot")) {
                    yHot = parseCIntegerLiteral(entry.getValue());
                }
            }
            if (width == -1) {
                throw new ImagingException("width not found");
            }
            if (height == -1) {
                throw new ImagingException("height not found");
            }

            final XbmParseResult xbmParseResult = new XbmParseResult();
            xbmParseResult.cParser = new BasicCParser(new ByteArrayInputStream(preprocessedFile.toByteArray()));
            xbmParseResult.xbmHeader = new XbmHeader(width, height, xHot, yHot);
            return xbmParseResult;
        }
    }
Constructs a new instance with the big-endian byte order.
src/main/java/org/apache/commons/imaging/formats/xbm/XbmImageParser.java