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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
Method details
Section titled “Method details”register
Section titled “register”void register(IResourceFormat format) static
Adds a format in front of the others; registering it again moves it to the front.
unregister
Section titled “unregister”void unregister(IResourceFormat format) static
Removes a format, a built-in one included.
decoder
Section titled “decoder”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
