- All Known Implementing Classes:
GBADiffUnfilterer,GBAHuffmanDecompressor,GBALZSSDecompressor,GBALZXDecompressor,GBARLDecompressor
public interface Decompressor
Decompresses data from a
Cartridge.
Unless otherwise noted, implementations are thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]decompress(Cartridge cartridge)Decompresses data starting at the current offset of the given cartridge.default byte[]decompress(Cartridge cartridge, long offset)Decompresses data starting at the given offset from the given cartridge.
-
Method Details
-
decompress
Decompresses data starting at the given offset from the given cartridge. The offset of the cartridge is not modified.- Parameters:
cartridge- the cartridgeoffset- the offset where compressed data starts- Returns:
- the decompressed data
- Throws:
DecompressionException- if an error occurs while attempting decompressionIllegalArgumentException- if the given offset is out of bounds, i.e. less than 0 or greater than or equal to {@code cartridge.size()}
-
decompress
Decompresses data starting at the current offset of the given cartridge. The offset of the cartridge is incremented by the number of bytes read.- Parameters:
cartridge- the cartridge- Returns:
- the decompressed data
- Throws:
DecompressionException- if an error occurs while attempting decompression
-