Package nom.tam.fits.compress
Class CompressionManager
java.lang.Object
nom.tam.fits.compress.CompressionManager
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStream
decompress
(InputStream compressed) This method decompresses a compressed input stream.static boolean
isCompressed
(File file) Is a file compressed? (the magic number in the first 2 bytes is used to detect the compression.static boolean
isCompressed
(String filename) Is a file compressed? (the magic number in the first 2 bytes is used to detect the compression.protected static ICompressProvider
nextCompressionProvider
(int mag1, int mag2, ICompressProvider old)
-
Field Details
-
ONE_MEGABYTE
public static final int ONE_MEGABYTE- See Also:
-
-
Method Details
-
decompress
This method decompresses a compressed input stream. The decompression method is selected automatically based upon the first two bytes read.- Parameters:
compressed
- The compressed input stream- Returns:
- A stream which wraps the input stream and decompresses it. If the input stream is not compressed, a pushback input stream wrapping the original stream is returned.
- Throws:
FitsException
- when the stream could not be read or decompressed
-
isCompressed
Is a file compressed? (the magic number in the first 2 bytes is used to detect the compression.- Parameters:
file
- file to test for compression algorithms- Returns:
- true if the file is compressed
-
isCompressed
Is a file compressed? (the magic number in the first 2 bytes is used to detect the compression.- Parameters:
filename
- of the file to test for compression algorithms- Returns:
- true if the file is compressed
-
nextCompressionProvider
protected static ICompressProvider nextCompressionProvider(int mag1, int mag2, ICompressProvider old)
-