Class Gzip

java.lang.Object
com.luna.common.file.compress.Gzip
All Implemented Interfaces:
Closeable, AutoCloseable

public class Gzip extends Object implements Closeable
GZIP是用于Unix系统的文件压缩
gzip的基础是DEFLATE
Since:
5.7.8
Author:
looly
  • Constructor Details

    • Gzip

      public Gzip(InputStream source, OutputStream target)
      构造
      Parameters:
      source - 源流
      target - 目标流
  • Method Details

    • of

      public static Gzip of(InputStream source, OutputStream target)
      创建Gzip
      Parameters:
      source - 源流
      target - 目标流
      Returns:
      Gzip
    • getTarget

      public OutputStream getTarget()
      获取目标流
      Returns:
      目标流
    • gzip

      public Gzip gzip()
      将普通数据流压缩
      Returns:
      Gzip
    • unGzip

      public Gzip unGzip()
      将压缩流解压到target中
      Returns:
      Gzip
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable