A Java library for reading and writing Electronic Arts IFF (Interchange File
Format) files, with codecs for ILBM images and 8SVX audio. It plugs
into the standard JDK plugin systems, so once registered, ILBM/8SVX files can
be read and written through javax.imageio.ImageIO and
javax.sound.sampled.AudioSystem like any other supported format.
dev.rambris.iff— generic IFF FORM reader/writer (IffReader,IffWriter) and chunk primitives.dev.rambris.iff.codec—IlbmCodec(ILBM images) andSvx8Codec(8SVX audio), plus their data records (IlbmImage,Svx8Sound,BmhdChunk,VhdrChunk).dev.rambris.iff.imageio—javax.imageioSPI:IlbmImageReader/IlbmImageWriter.dev.rambris.iff.audio—javax.sound.sampledSPI:Svx8AudioFileReader/Svx8AudioFileWriter.
The SPI providers are registered under META-INF/services, so they're
discovered automatically by ImageIO/AudioSystem as soon as this jar is on
the classpath — no manual registration needed.
<dependency>
<groupId>dev.rambris</groupId>
<artifactId>iff</artifactId>
<version>1.0.0</version>
</dependency>Requires Java 17 or newer.
IlbmImage image = IlbmCodec.read(Path.of("picture.iff"));
Svx8Sound sound = Svx8Codec.read(Path.of("sample.8svx"));
IlbmCodec.write(image, Path.of("out.iff"));
Svx8Codec.write(sound, Path.of("out.8svx"));BufferedImage image = ImageIO.read(new File("picture.iff"));
ImageIO.write(image, "ILBM", new File("out.iff"));AudioInputStream stream = AudioSystem.getAudioInputStream(new File("sample.8svx"));
AudioSystem.write(stream, Svx8AudioFileTypes.SVX8, new File("out.8svx"));For formats this library doesn't have a dedicated codec for, IffReader/
IffWriter give direct access to FORM chunks:
String formType = new IffReader()
.on(IlbmId.BMHD, (id, data) -> bmhd = BmhdChunk.parse(data))
.on(IlbmId.BODY, (id, data) -> body = data)
.read(path);Reflection/resource configuration for native-image is shipped under
META-INF/native-image/dev.rambris/iff/ and picked up automatically.
./mvnw verify
Issues and pull requests are welcome at https://github.com/fredrik-rambris/java-iff.
Licensed under the Apache License, Version 2.0.