Skip to main content
The format parser modules (FormatBMP, FormatCLASS, FormatJPEG, FormatPNG, FormatZIP, and the in-development FormatDEX and FormatELF) are ordinary Java modules with no GUI or HTTP server code in them. They depend only on CommonLib and the JDK, so you can drop one or more of them into your own project to parse binary files programmatically, walk the resulting component tree, and extract structured data — all without starting a Swing application or a web server.

Available Format JARs

FormatBMP

Parser for the BMP (Device Independent Bitmap) image format. Parses the file header, DIB header, color table, and pixel array.

FormatCLASS

Parser for Java .class files. Decodes the constant pool, fields, methods, and all standard JVM attributes.

FormatJPEG

Parser for JPEG image files. Walks the JPEG segment markers and their payloads.

FormatPNG

Parser for PNG image files. Decodes the PNG signature and all chunk types.

FormatZIP

Parser for ZIP archive files. Decodes local file entries, the central directory, and the end-of-central-directory record.

FormatDEX

In development. Parser for Android Dalvik Executable (DEX) files. API may change between releases.

FormatELF

In development. Parser for ELF (Executable and Linkable Format) binaries used on Linux and other Unix-like systems. API may change between releases.
All format JARs depend only on CommonLib and the JDK — no third-party runtime libraries are required. Adding a single format JAR to your project brings in exactly two JARs: the format module itself and CommonLib.
FormatDEX and FormatELF are still in active development. Their public APIs — class names, field names, and method signatures — may change between releases without notice. Use them in production code only if you are prepared to update call sites when a new version ships.

Adding a Format JAR to Your Project

The format JARs are not yet published to Maven Central. You must build them locally first:
After mvn install, the JARs are available in your local Maven repository (~/.m2/repository/org/binaryinternals/). Reference them in your own project’s pom.xml:
Each format module transitively depends on CommonLib, so you do not need to list CommonLib separately.

Parsing a File Programmatically

Using a Format Class Directly

Instantiate the format class with a java.nio.file.Path, then call generateTreeNode to build the component tree. The tree consists of DefaultMutableTreeNode objects whose getUserObject() returns a JTreeNodeFileComponent.
Walk the tree recursively to inspect every parsed component:
Each JTreeNodeFileComponent exposes:

Getting JSON Output Without the HTTP Layer

If you want JSON output but do not want to run the embedded web server, use ParseService from the BinaryInternalsWeb module directly. ParseService uses ServiceLoader to find all format plugins on the module path, then parses the given bytes and serializes the tree to JSON. First add BinaryInternalsWeb to your dependencies:
Then call ParseService.parse():
ParseService selects the correct parser by the file extension in the fileName argument, writes a temporary copy of fileBytes to the tempDir you provide, parses it, and immediately deletes the temporary file. The returned JSON has the shape:
Fields icon, description, and children are omitted from nodes where they are absent. You can also inspect the list of loaded plugins before parsing:
Or get the full formats list as a JSON string:

Module Path Configuration

If your project uses the Java Platform Module System, add the provides usage declaration to your own module-info.java so the ServiceLoader wiring is explicit:
When running from the command line, place all JARs on the module path (not the classpath) so that the provides / uses wiring in module-info.java is honoured: