Skip to content

ResourceFormat

final class ResourceFormat
Package: dev.joid.lib.resource.format · Module: core · Source: ResourceFormat.java

The registry of the resource formats, which picks the decoder of a file from its first bytes.

The built-in formats read the files of Supported formats; a file that none of them recognizes goes to the bundled image readers. The last registered format is asked first.

ReturnsSignatureSummary
voidregister(IResourceFormat format) staticAdds a format in front of the others; registering it again moves it to the front.
voidunregister(IResourceFormat format) staticRemoves a format, a built-in one included.
IResourceDecoderdecoder(Asset asset) staticReads the first 4096 bytes of asset and returns the decoder of the first format that supports them, otherwise a RasterResourceDecoder.

void register(IResourceFormat format) static

Adds a format in front of the others; registering it again moves it to the front.

void unregister(IResourceFormat format) static

Removes a format, a built-in one included.

IResourceDecoder decoder(Asset asset) static

Reads the first 4096 bytes of asset and returns the decoder of the first format that supports them, otherwise a RasterResourceDecoder. Throws UncheckedIOException when the asset cannot be read.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page