class MultiPointOutputStream {

    public void done(int blockIndex) throws IOException {
        noMoreStreamList.add(blockIndex);

        try {
            if (syncException != null) throw syncException;

            if (syncFuture != null && !syncFuture.isDone()) {
                final AtomicLong noSyncLength = noSyncLengthMap.get(blockIndex);
                if (noSyncLength != null && noSyncLength.get() > 0) {
                    inspectStreamState(doneState);
                    final boolean isNoMoreStream = doneState.isNoMoreStream;

                    // ensure this block is synced.
                    ensureSync(isNoMoreStream, blockIndex);
                }
            } else {
                if (syncFuture == null) {
                    Util.d(TAG, "OutputStream done but no need to ensure sync, because the "
                            + "sync job not run yet. task[" + task.getId()
                            + "] block[" + blockIndex + "]");
                } else {
                    Util.d(TAG, "OutputStream done but no need to ensure sync, because the "
                            + "syncFuture.isDone[" + syncFuture.isDone() + "] task[" + task.getId()
                            + "] block[" + blockIndex + "]");

                }
            }

        } finally {
            close(blockIndex);
        }
    }

      MultiPointOutputStream(@NonNull final DownloadTask task,
                           @NonNull BreakpointInfo info,
                           @NonNull DownloadStore store,
                           @Nullable Runnable syncRunnable);
    public  MultiPointOutputStream(@NonNull DownloadTask task,
                                  @NonNull BreakpointInfo info,
                                  @NonNull DownloadStore store);

}