Class BaseCompressor

  • All Implemented Interfaces:
    Zip
    Direct Known Subclasses:
    GzipImpl

    public abstract class BaseCompressor
    extends BaseZip
    apache 基础 compress 包实现
    Author:
    wudi
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseCompressor()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected byte[] compress0​(byte[] b)
      实际压缩算法的实现
      protected byte[] extract0​(byte[] b)
      实际的解压缩算法
      protected abstract java.io.InputStream is​(java.io.ByteArrayInputStream bis)
      根据子类实现生成解压流
      protected abstract java.io.OutputStream os​(java.io.ByteArrayOutputStream bos)
      根据子类实现生成压缩流
      • Methods inherited from class java.lang.Object

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

      • BaseCompressor

        public BaseCompressor()
    • Method Detail

      • compress0

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

        protected byte[] extract0​(byte[] b)
                           throws java.lang.Exception
        Description copied from class: BaseZip
        实际的解压缩算法
        Specified by:
        extract0 in class BaseZip
        Parameters:
        b - 字节数组
        Returns:
        压缩后数据
        Throws:
        java.lang.Exception - 抛出的异常
      • is

        protected abstract java.io.InputStream is​(java.io.ByteArrayInputStream bis)
                                           throws java.lang.Exception
        根据子类实现生成解压流
        Parameters:
        bis - 字节输入流
        Returns:
        Throws:
        java.lang.Exception
      • os

        protected abstract java.io.OutputStream os​(java.io.ByteArrayOutputStream bos)
                                            throws java.lang.Exception
        根据子类实现生成压缩流
        Parameters:
        bos - 字节输出流
        Returns:
        Throws:
        java.lang.Exception