CBZ libraries for Java
Java has two good options for CBZ:
- java.util.zip is built into the JDK.
ZipFilegives random access to entries;ZipOutputStreamwrites archives. Enough for most comic code. - Apache Commons Compress handles ZIP edge cases better (ZIP64, names in legacy encodings, writing stored entries without precomputing CRCs) and also reads and writes 7z (CB7) and TAR (CBT). For RAR (CBR) use junrar.
Parse ComicInfo.xml with the JDK’s built-in DOM parser (javax.xml.parsers).
- Commons Compress Read and write CBZ comic book archives in Java with Apache Commons Compress: pages in natural order, cover, ComicInfo.xml.
- java.util.zip Read and write CBZ comic book archives in Java with java.util.zip: list pages in natural order, extract the cover, read ComicInfo.xml.