com.jscape.zip

## Class Gzip

- java.lang.Object
- - com.jscape.zip.Gzip

- All Implemented Interfaces:
    Archive

      public class Gzip
      extends java.lang.Object
      implements Archive

  Implements the basic functionality of GZIP compression and decompression.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `BUF_SIZE` Buffer size.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Gzip()` Creates a new Gzip instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addArchiveListener(ArchiveListener listener)` Adds listeners.
    `void` | `compress(java.io.File file)` GZIP the input file.
    `void` | `compress(java.io.File file, java.io.File output)` GZIP the input file to specified output file or directory.
    `void` | `decompress(java.io.File file)` GUNZIP the input archive.
    `void` | `decompress(java.io.File file, java.io.File output)` GUNZIP the input archive to specified output directory.
    `void` | `removeArchiveListener(ArchiveListener listener)` Remove listeners.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### BUF_SIZE

          public static final int BUF_SIZE

      Buffer size.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Gzip

          public Gzip()

      Creates a new Gzip instance.

  - ### Method Detail

    - #### compress

          public void compress(java.io.File file)
                        throws ArchiveException

      GZIP the input file.
      Specified by:
        `compress` in interface `Archive`
      Parameters:
        `file` - the file to compress
      Throws:
        `ArchiveException` - if error occurs

    - #### compress

          public void compress(java.io.File file,
                               java.io.File output)
                        throws ArchiveException

      GZIP the input file to specified output file or directory.
      Specified by:
        `compress` in interface `Archive`
      Parameters:
        `file` - the file to compress
        `output` - the output file or directory to write to
      Throws:
        `ArchiveException` - if error occurs

    - #### decompress

          public void decompress(java.io.File file)
                          throws ArchiveException

      GUNZIP the input archive.
      Specified by:
        `decompress` in interface `Archive`
      Parameters:
        `file` - the file to decompress.
      Throws:
        `ArchiveException` - if error occurs

    - #### decompress

          public void decompress(java.io.File file,
                                 java.io.File output)
                          throws ArchiveException

      GUNZIP the input archive to specified output directory. Assumes that the input file name ends with .gz extension.
      Specified by:
        `decompress` in interface `Archive`
      Parameters:
        `file` - the file to decompress
        `output` - the directory for decompress the GZIP file
      Throws:
        `ArchiveException` - if error occurs

    - #### addArchiveListener

          public void addArchiveListener(ArchiveListener listener)

      Adds listeners.
      Specified by:
        `addArchiveListener` in interface `Archive`
      Parameters:
        `listener` - the listener
      See Also:
        `*`

    - #### removeArchiveListener

          public void removeArchiveListener(ArchiveListener listener)

      Remove listeners.
      Specified by:
        `removeArchiveListener` in interface `Archive`
      Parameters:
        `listener` - the listener
      See Also:
        `Archive.removeArchiveListener(ArchiveListener)`

Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved