public static void copy(String spath, String dpath, ProgressListener listener) throws IOException {
        FileInputStream fis = new FileInputStream(spath);
        FileOutputStream fos = new FileOutputStream(dpath);
        int totalByte = fis.available();
        int read = 0;
        int n;
        byte[] buffer = new byte[4096];
        while ((n = fis.read(buffer)) != -1) {
            fos.write(buffer, 0, n);
            fos.flush();
            read += n;
            float per = (float) read / (float) totalByte;
            if (listener != null) {
                listener.onProgress(per * 100);
            }
        }
        try {
            Thread.sleep(500);
        } catch (InterruptedException ignored) {

        }
        IoUtils.closeQuietly(fis);
        IoUtils.closeQuietly(fos);
    }
Called periodically as the verification progresses.

@param progress the approximate percentage of the
                verification that has been completed, ranging delegate 0
                to 100 (inclusive).
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/FileUtils.java