Top Description Fields Constructors Methods
org.apache.commons.compress.compressors.gzip

public Class GzipParameters

extends Object
Class Inheritance
Imports
java.io.OutputStream, java.util.zip.Deflater

Parameters for the GZIP compressor.
Since
1.7
See Also
GzipCompressorInputStream, GzipCompressorOutputStream

Field Summary

Modifier and TypeField and Description
private int
private String
private int
private int
private String
private long
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The size of the buffer used to retrieve compressed data.
getBufferSize
()

Gets size of the buffer used to retrieve compressed data.

public String
public int
public int

Returns:

the deflater strategy, Deflater#DEFAULT_STRATEGY by default.
getDeflateStrategy
()

Gets the deflater strategy.

public String

Returns:

the file name.
getFilename
()

Deprecated Use getFileName().
Gets the file name.
public String

Returns:

the file name.
getFileName
()

Gets the file name.

public long
public int
public void
setBufferSize(final int
the bufferSize to set. Must be a positive value.
bufferSize
)

Sets size of the buffer used to retrieve compressed data from Deflater and write to underlying OutputStream.

public void
setComment(final String comment)

public void
setCompressionLevel(final int
the compression level (between 0 and 9)
compressionLevel
)

Sets the compression level.

public void
setDeflateStrategy(final int
the new compression strategy
deflateStrategy
)

Sets the deflater strategy.

public void
setFilename(final String
the name of the file without the directory path
fileName
)

Deprecated Use setFileName(String).
Sets the name of the compressed file.
public void
setFileName(final String
the name of the file without the directory path
fileName
)

Sets the name of the compressed file.

public void
setModificationTime(final long
the modification time, in milliseconds
modificationTime
)

Sets the modification time of the compressed file.

public void
setOperatingSystem(final int
the code of the operating system
operatingSystem
)

Sets the operating system on which the compression took place.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferSizeback to summary
private int bufferSize
commentback to summary
private String comment
compressionLevelback to summary
private int compressionLevel
deflateStrategyback to summary
private int deflateStrategy
fileNameback to summary
private String fileName
modificationTimeback to summary
private long modificationTime
operatingSystemback to summary
private int operatingSystem

Constructor Detail

GzipParametersback to summary
public GzipParameters()

Method Detail

getBufferSizeback to summary
public int getBufferSize()

Gets size of the buffer used to retrieve compressed data.

Returns:int

The size of the buffer used to retrieve compressed data.

Since
1.21
See Also
setBufferSize(int)
getCommentback to summary
public String getComment()
getCompressionLevelback to summary
public int getCompressionLevel()
getDeflateStrategyback to summary
public int getDeflateStrategy()

Gets the deflater strategy.

Returns:int

the deflater strategy, Deflater#DEFAULT_STRATEGY by default.

Since
1.23
See Also
setDeflateStrategy(int), Deflater#setStrategy(int)
getFilenameback to summary
public String getFilename()

Deprecated

Use getFileName().

Gets the file name.

Returns:String

the file name.

Annotations
@Deprecated
getFileNameback to summary
public String getFileName()

Gets the file name.

Returns:String

the file name.

Since
2.25.0
getModificationTimeback to summary
public long getModificationTime()
getOperatingSystemback to summary
public int getOperatingSystem()
setBufferSizeback to summary
public void setBufferSize(final int bufferSize)

Sets size of the buffer used to retrieve compressed data from Deflater and write to underlying OutputStream.

Parameters
bufferSize:int

the bufferSize to set. Must be a positive value.

Since
1.21
setCommentback to summary
public void setComment(final String comment)
setCompressionLevelback to summary
public void setCompressionLevel(final int compressionLevel)

Sets the compression level.

Parameters
compressionLevel:int

the compression level (between 0 and 9)

See Also
Deflater#NO_COMPRESSION, Deflater#BEST_SPEED, Deflater#DEFAULT_COMPRESSION, Deflater#BEST_COMPRESSION
setDeflateStrategyback to summary
public void setDeflateStrategy(final int deflateStrategy)

Sets the deflater strategy.

Parameters
deflateStrategy:int

the new compression strategy

Since
1.23
See Also
Deflater#setStrategy(int)
setFilenameback to summary
public void setFilename(final String fileName)

Deprecated

Use setFileName(String).

Sets the name of the compressed file.

Parameters
fileName:String

the name of the file without the directory path

Annotations
@Deprecated
setFileNameback to summary
public void setFileName(final String fileName)

Sets the name of the compressed file.

Parameters
fileName:String

the name of the file without the directory path

setModificationTimeback to summary
public void setModificationTime(final long modificationTime)

Sets the modification time of the compressed file.

Parameters
modificationTime:long

the modification time, in milliseconds

setOperatingSystemback to summary
public void setOperatingSystem(final 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:int

the code of the operating system