Class CompressionManager


  • public final class CompressionManager
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CompressionManager()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.InputStream decompress​(java.io.InputStream compressed)
      This method decompresses a compressed input stream.
      static boolean isCompressed​(java.io.File file)
      Is a file compressed? (the magic number in the first 2 bytes is used to detect the compression.
      static boolean isCompressed​(java.lang.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)  
      private static ICompressProvider selectCompressionProvider​(int mag1, int mag2)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COMPRESS_EXTENTION

        private static final java.lang.String COMPRESS_EXTENTION
        See Also:
        Constant Field Values
      • LOG

        private static final java.util.logging.Logger LOG
        logger to log to.
    • Constructor Detail

      • CompressionManager

        private CompressionManager()
    • Method Detail

      • decompress

        public static java.io.InputStream decompress​(java.io.InputStream compressed)
                                              throws FitsException
        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

        public static boolean isCompressed​(java.io.File file)
        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

        public static boolean isCompressed​(java.lang.String filename)
        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
      • selectCompressionProvider

        private static ICompressProvider selectCompressionProvider​(int mag1,
                                                                   int mag2)