Package nom.tam.fits.compress
Class BasicCompressProvider
java.lang.Object
nom.tam.fits.compress.BasicCompressProvider
- All Implemented Interfaces:
ICompressProvider
Deprecated.
(for internal use) UNIX compressed (
.Z) input stream decompression with a preference for using an
external system command. You can use this class to decompress files that have been compressed with the UNIX
compress tool (or via gzip) and have the characteristic .Z file name extension. It
effectively provides the same functionality as ZCompressionProvider, but has a preference for calling on the
system uncompress command first to do the lifting. If that fails it will call on CompressionManager to
provide a suitable decompressor (which will give it ZCompressionProvider). Since the compress tool is
UNIX-specific, it is not entirely portable. As a result, you are probably better off relying on those other classes
directly.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Decompresses data from an input stream.intpriority()Deprecated.Returns the priority of this method.booleanprovides(int mag1, int mag2) Deprecated.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.
-
Constructor Details
-
BasicCompressProvider
public BasicCompressProvider()Deprecated.
-
-
Method Details
-
decompress
Deprecated.Description copied from interface:ICompressProviderDecompresses data from an input stream.- Specified by:
decompressin interfaceICompressProvider- 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
public int priority()Deprecated.Description copied from interface:ICompressProviderReturns the priority of this method.CompressionManagerwill 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.- Specified by:
priorityin interfaceICompressProvider- Returns:
- the priority of this decompression method vs similar other compression methods that may be avaialble.
- See Also:
-
provides
public boolean provides(int mag1, int mag2) Deprecated.Description copied from interface:ICompressProviderChecks 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.- Specified by:
providesin interfaceICompressProvider- Parameters:
mag1- the first byte of the compressed filemag2- the second byte of the compressed file- Returns:
trueif this class can be used to decompress the given file, or elsefalse.
-
ZCompressionProvider. or the more genericCompressionManagerwith a preference toward using the system command if possible. instead.