Class BaseZip

  • All Implemented Interfaces:
    Zip
    Direct Known Subclasses:
    BaseCompressor, ZipImpl, ZlibImpl

    public abstract class BaseZip
    extends java.lang.Object
    implements Zip
    基础压缩实现
    Author:
    WD
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseZip()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] compress​(byte[] b)
      压缩数据
      protected abstract byte[] compress0​(byte[] b)
      实际压缩算法的实现
      byte[] extract​(byte[] b)
      解压数据
      protected abstract byte[] extract0​(byte[] b)
      实际的解压缩算法
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BaseZip

        public BaseZip()
    • Method Detail

      • compress

        public final byte[] compress​(byte[] b)
        Description copied from interface: Zip
        压缩数据
        Specified by:
        compress in interface Zip
        Parameters:
        b - 字节数组
        Returns:
        压缩后的字节数组
      • extract

        public final byte[] extract​(byte[] b)
        Description copied from interface: Zip
        解压数据
        Specified by:
        extract in interface Zip
        Parameters:
        b - 压缩字节
        Returns:
        解压后数据
      • compress0

        protected abstract byte[] compress0​(byte[] b)
                                     throws java.lang.Exception
        实际压缩算法的实现
        Parameters:
        b - 字节数组
        Returns:
        压缩后数据
        Throws:
        java.lang.Exception - 抛出的异常
      • extract0

        protected abstract byte[] extract0​(byte[] b)
                                    throws java.lang.Exception
        实际的解压缩算法
        Parameters:
        b - 字节数组
        Returns:
        压缩后数据
        Throws:
        java.lang.Exception - 抛出的异常