Package org.apache.commons.compress.compressors.gzip

# Class GzipParameters

java.lang.Object
org.apache.commons.compress.compressors.gzip.GzipParameters

public class GzipParameters extends Object
Parameters for the GZIP compressor.

Since:
  1.7
See Also:
  - `GzipCompressorInputStream`
  - `GzipCompressorOutputStream`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GzipParameters()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getBufferSize()`
  Gets size of the buffer used to retrieve compressed data.
  `String`
  `getComment()`
  `int`
  `getCompressionLevel()`
  `int`
  `getDeflateStrategy()`
  Gets the deflater strategy.
  `String`
  `getFilename()`
  Deprecated.
  Use `getFileName()`.
  `String`
  `getFileName()`
  Gets the file name.
  `long`
  `getModificationTime()`
  `int`
  `getOperatingSystem()`
  `void`
  `setBufferSize(int bufferSize)`
  Sets size of the buffer used to retrieve compressed data from `Deflater` and write to underlying `OutputStream`.
  `void`
  `setComment(String comment)`
  `void`
  `setCompressionLevel(int compressionLevel)`
  Sets the compression level.
  `void`
  `setDeflateStrategy(int deflateStrategy)`
  Sets the deflater strategy.
  `void`
  `setFilename(String fileName)`
  Deprecated.
  Use `setFileName(String)`.
  `void`
  `setFileName(String fileName)`
  Sets the name of the compressed file.
  `void`
  `setModificationTime(long modificationTime)`
  Sets the modification time of the compressed file.
  `void`
  `setOperatingSystem(int operatingSystem)`
  Sets the operating system on which the compression took place.

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

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

- ## Constructor Details

  - ### GzipParameters

    public GzipParameters()

- ## Method Details

  - ### getBufferSize

    public int getBufferSize()
    Gets size of the buffer used to retrieve compressed data.
    Returns:
      The size of the buffer used to retrieve compressed data.
    Since:
      1.21
    See Also:
      - `setBufferSize(int)`

  - ### getComment

    public String getComment()

  - ### getCompressionLevel

    public int getCompressionLevel()

  - ### getDeflateStrategy

    public int getDeflateStrategy()
    Gets the deflater strategy.
    Returns:
      the deflater strategy, `Deflater.DEFAULT_STRATEGY` by default.
    Since:
      1.23
    See Also:
      - `setDeflateStrategy(int)`
      - `Deflater.setStrategy(int)`

  - ### getFilename

    @Deprecated public String getFilename()
    Deprecated.
    Use `getFileName()`.
    Gets the file name.
    Returns:
      the file name.

  - ### getFileName

    public String getFileName()
    Gets the file name.
    Returns:
      the file name.
    Since:
      2.25.0

  - ### getModificationTime

    public long getModificationTime()

  - ### getOperatingSystem

    public int getOperatingSystem()

  - ### setBufferSize

    public void setBufferSize(int bufferSize)
    Sets size of the buffer used to retrieve compressed data from `Deflater` and write to underlying `OutputStream`.
    Parameters:
      `bufferSize` - the bufferSize to set. Must be a positive value.
    Since:
      1.21

  - ### setComment

    public void setComment(String comment)

  - ### setCompressionLevel

    public void setCompressionLevel(int compressionLevel)
    Sets the compression level.
    Parameters:
      `compressionLevel` - the compression level (between 0 and 9)
    See Also:
      - `Deflater.NO_COMPRESSION`
      - `Deflater.BEST_SPEED`
      - `Deflater.DEFAULT_COMPRESSION`
      - `Deflater.BEST_COMPRESSION`

  - ### setDeflateStrategy

    public void setDeflateStrategy(int deflateStrategy)
    Sets the deflater strategy.
    Parameters:
      `deflateStrategy` - the new compression strategy
    Since:
      1.23
    See Also:
      - `Deflater.setStrategy(int)`

  - ### setFilename

    @Deprecated public void setFilename(String fileName)
    Deprecated.
    Use `setFileName(String)`.
    Sets the name of the compressed file.
    Parameters:
      `fileName` - the name of the file without the directory path

  - ### setFileName

    public void setFileName(String fileName)
    Sets the name of the compressed file.
    Parameters:
      `fileName` - the name of the file without the directory path

  - ### setModificationTime

    public void setModificationTime(long modificationTime)
    Sets the modification time of the compressed file.
    Parameters:
      `modificationTime` - the modification time, in milliseconds

  - ### setOperatingSystem

    public void setOperatingSystem(int operatingSystem)
    Sets the operating system on which the compression took place. The defined values are:
    - 0: FAT file system (MS-DOS, OS/2, NT/Win32)
    - 1: Amiga
    - 2: VMS (or OpenVMS)
    - 3: Unix
    - 4: VM/CMS
    - 5: Atari TOS
    - 6: HPFS file system (OS/2, NT)
    - 7: Macintosh
    - 8: Z-System
    - 9: CP/M
    - 10: TOPS-20
    - 11: NTFS file system (NT)
    - 12: QDOS
    - 13: Acorn RISCOS
    - 255: Unknown
    Parameters:
      `operatingSystem` - the code of the operating system