Class CompressionManager


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

      Fields 
      Modifier and Type Field Description
      static int ONE_MEGABYTE  
    • 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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