code: public static String formatSize(long size) {
          if (size < ValueConsts.KB) {
              return size + " B";
          } else if (size < ValueConsts.MB) {
              return formatDecimal((double) size / ValueConsts.KB) + " KB";
          } else if (size < ValueConsts.GB) {
              return formatDecimal((double) size / ValueConsts.MB) + " MB";
          } else if (size < ValueConsts.TB) {
              return formatDecimal((double) size / ValueConsts.GB) + " GB";
          } else {
              return formatDecimal((double) size / ValueConsts.TB) + " TB";
          }
      }
docs: 格式文件大小
  
  @param size 单位为B的文件大小
  
  @return 格式化为KB、MB、GB、TB的{@link String}