Class Pack200CompressorInputStream

    • Constructor Summary

      Constructors 
      Constructor Description
      Pack200CompressorInputStream​(java.io.File f)
      Decompresses the given file, caching the decompressed data in memory.
      Pack200CompressorInputStream​(java.io.File f, java.util.Map<java.lang.String,​java.lang.String> props)
      Decompresses the given file, caching the decompressed data in memory and using the given properties.
      Pack200CompressorInputStream​(java.io.File f, Pack200Strategy mode)
      Decompresses the given file using the given strategy to cache the results.
      Pack200CompressorInputStream​(java.io.File f, Pack200Strategy mode, java.util.Map<java.lang.String,​java.lang.String> props)
      Decompresses the given file using the given strategy to cache the results and the given properties.
      Pack200CompressorInputStream​(java.io.InputStream in)
      Decompresses the given stream, caching the decompressed data in memory.
      Pack200CompressorInputStream​(java.io.InputStream in, java.util.Map<java.lang.String,​java.lang.String> props)
      Decompresses the given stream, caching the decompressed data in memory and using the given properties.
      Pack200CompressorInputStream​(java.io.InputStream in, Pack200Strategy mode)
      Decompresses the given stream using the given strategy to cache the results.
      Pack200CompressorInputStream​(java.io.InputStream in, Pack200Strategy mode, java.util.Map<java.lang.String,​java.lang.String> props)
      Decompresses the given stream using the given strategy to cache the results and the given properties.
    • Constructor Detail

      • Pack200CompressorInputStream

        public Pack200CompressorInputStream​(java.io.InputStream in)
                                     throws java.io.IOException
        Decompresses the given stream, caching the decompressed data in memory.

        When reading from a file the File-arg constructor may provide better performance.

        Parameters:
        in - the InputStream from which this object should be created
        Throws:
        java.io.IOException - if reading fails
      • Pack200CompressorInputStream

        public Pack200CompressorInputStream​(java.io.InputStream in,
                                            Pack200Strategy mode)
                                     throws java.io.IOException
        Decompresses the given stream using the given strategy to cache the results.

        When reading from a file the File-arg constructor may provide better performance.

        Parameters:
        in - the InputStream from which this object should be created
        mode - the strategy to use
        Throws:
        java.io.IOException - if reading fails
      • Pack200CompressorInputStream

        public Pack200CompressorInputStream​(java.io.InputStream in,
                                            java.util.Map<java.lang.String,​java.lang.String> props)
                                     throws java.io.IOException
        Decompresses the given stream, caching the decompressed data in memory and using the given properties.

        When reading from a file the File-arg constructor may provide better performance.

        Parameters:
        in - the InputStream from which this object should be created
        props - Pack200 properties to use
        Throws:
        java.io.IOException - if reading fails
      • Pack200CompressorInputStream

        public Pack200CompressorInputStream​(java.io.InputStream in,
                                            Pack200Strategy mode,
                                            java.util.Map<java.lang.String,​java.lang.String> props)
                                     throws java.io.IOException
        Decompresses the given stream using the given strategy to cache the results and the given properties.

        When reading from a file the File-arg constructor may provide better performance.

        Parameters:
        in - the InputStream from which this object should be created
        mode - the strategy to use
        props - Pack200 properties to use
        Throws:
        java.io.IOException - if reading fails
      • Pack200CompressorInputStream

        public Pack200CompressorInputStream​(java.io.File f)
                                     throws java.io.IOException
        Decompresses the given file, caching the decompressed data in memory.
        Parameters:
        f - the file to decompress
        Throws:
        java.io.IOException - if reading fails
      • Pack200CompressorInputStream

        public Pack200CompressorInputStream​(java.io.File f,
                                            Pack200Strategy mode)
                                     throws java.io.IOException
        Decompresses the given file using the given strategy to cache the results.
        Parameters:
        f - the file to decompress
        mode - the strategy to use
        Throws:
        java.io.IOException - if reading fails
      • Pack200CompressorInputStream

        public Pack200CompressorInputStream​(java.io.File f,
                                            java.util.Map<java.lang.String,​java.lang.String> props)
                                     throws java.io.IOException
        Decompresses the given file, caching the decompressed data in memory and using the given properties.
        Parameters:
        f - the file to decompress
        props - Pack200 properties to use
        Throws:
        java.io.IOException - if reading fails
      • Pack200CompressorInputStream

        public Pack200CompressorInputStream​(java.io.File f,
                                            Pack200Strategy mode,
                                            java.util.Map<java.lang.String,​java.lang.String> props)
                                     throws java.io.IOException
        Decompresses the given file using the given strategy to cache the results and the given properties.
        Parameters:
        f - the file to decompress
        mode - the strategy to use
        props - Pack200 properties to use
        Throws:
        java.io.IOException - if reading fails
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int count)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • available

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException
      • markSupported

        public boolean markSupported()
        Overrides:
        markSupported in class java.io.InputStream
      • mark

        public void mark​(int limit)
        Overrides:
        mark in class java.io.InputStream
      • reset

        public void reset()
                   throws java.io.IOException
        Overrides:
        reset in class java.io.InputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long count)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.InputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • matches

        public static boolean matches​(byte[] signature,
                                      int length)
        Checks if the signature matches what is expected for a pack200 file (0xCAFED00D).
        Parameters:
        signature - the bytes to check
        length - the number of bytes to check
        Returns:
        true, if this stream is a pack200 compressed stream, false otherwise