Package nom.tam.fits.compress
Interface ICompressProvider
- All Known Implementing Classes:
BasicCompressProvider
,BZip2CompressionProvider
,ExternalBZip2CompressionProvider
,GZipCompressionProvider
,ZCompressionProvider
public interface ICompressProvider
(for internal use) Input stream decompression interface.
-
Method Summary
Modifier and TypeMethodDescriptionDecompresses data from an input stream.int
priority()
Returns the priority of this method.boolean
provides
(int byte1, int byte2) Checks if this compression method can support the magic integer number that is used to identify the type of compression at the beginning of compressed files, and is stored as the first 2 bytes of compressed data.
-
Method Details
-
decompress
Decompresses data from an input stream.- Parameters:
in
- the input stream containing compressed data- Returns:
- a new input stream containing the decompressed data
- Throws:
IOException
- if there was an IO error while accessing the input streamFitsException
- if the decompression cannot be performed for some reason that is not related to the input per se.
-
priority
int priority()Returns the priority of this method.CompressionManager
will use this to select the 'best' compression class when multiple compression classes can provide decompression support for a given input stream. Claases that have a higher priority will be preferred.- Returns:
- the priority of this decompression method vs similar other compression methods that may be avaialble.
- See Also:
-
provides
boolean provides(int byte1, int byte2) Checks if this compression method can support the magic integer number that is used to identify the type of compression at the beginning of compressed files, and is stored as the first 2 bytes of compressed data.- Parameters:
byte1
- the first byte of the compressed filebyte2
- the second byte of the compressed file- Returns:
true
if this class can be used to decompress the given file, or elsefalse
.
-