private static File renameWithSize(final File sourceFile, final File targetDir) {
    final String sourceFileBaseName = FilenameUtils.getBaseName(sourceFile.getName());
    final String sourceFileExtension = FilenameUtils.getExtension(sourceFile.getName());

    // If the file sizes are different, rename the source file by appending its size and the
    // current timestamp
    final String newFileName =
        String.format(
            "%s_%s_%s.%s",
            sourceFileBaseName,
            sourceFile.length(),
            System.currentTimeMillis(),
            sourceFileExtension);

    return new File(targetDir, newFileName);
  }
Transfer bytes to human-readable string. Copy from <a
href="https://stackoverflow.com/a/3758880">stackoverflow</a>.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java