Class CompressionManager

java.lang.Object
nom.tam.fits.compress.CompressionManager

public final class CompressionManager extends Object
  • Field Details

  • Constructor Details

    • CompressionManager

      private CompressionManager()
  • Method Details

    • decompress

      public static InputStream decompress(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(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(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)
    • nextCompressionProvider

      protected static ICompressProvider nextCompressionProvider(int mag1, int mag2, ICompressProvider old)