Giter VIP home page Giter VIP logo

xeonbsdiff's Introduction

XeonDiff

超简单在Android端通过bsdiff实现件差分与文件合并。快速实现增量更新功能

先上图:

生成补丁包

生成补丁包

合并补丁包 合并补丁包

产生的文件: 产生的文件

代码示例:

1.添加依赖

implementation "com.xeonyu:bsdiff:1.0.4"

2.生成补丁包

/*生成补丁包,耗时操作,记得放在子线程  返回值 0表示成功*/
val result = BsDiffTool.diff(
    newFile.absolutePath,//新文件path
    oldFile.absolutePath,//旧文件path
    patchFile.absolutePath//补丁文件path
    )

3.合并补丁包

/*合并补丁包,耗时操作,记得放在子线程  返回值 0表示成功*/
    val result = BsDiffTool.patch(
        oldFile.absolutePath,
        patchFile.absolutePath,
        combineFile.absolutePath
    )

4.合并补丁包后记得对比下新文件和合并后文件的MD5值, MD5值一致表示成功。

如果需要自己生成so库,请看博客: https://blog.csdn.net/yuzhiqiang_1993/article/details/121317195

source目录中有bzip和bsdiff源码文件。

xeonbsdiff's People

Contributors

yuzhiqiang1993 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.