本文整理了Java中cn.hutool.core.io.FileUtil.readableFileSize()
方法的一些代码示例,展示了FileUtil.readableFileSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.readableFileSize()
方法的具体详情如下:
包路径:cn.hutool.core.io.FileUtil
类名称:FileUtil
方法名:readableFileSize
[英]可读的文件大小
参考 http://stackoverflow.com/questions/3263892/format-file-size-as-mb-gb-etc
[中]可读的文件大小
参考 http://stackoverflow.com/questions/3263892/format-file-size-as-mb-gb-etc
代码示例来源:origin: looly/hutool
/**
* 可读的文件大小
* @return 大小
*/
public String readableFileSize() {
return FileUtil.readableFileSize(file.length());
}
}
代码示例来源:origin: looly/hutool
/**
* 可读的文件大小
*
* @param file 文件
* @return 大小
*/
public static String readableFileSize(File file) {
return readableFileSize(file.length());
}
代码示例来源:origin: looly/hutool
/**
* 可读的文件大小
*
* @param file 文件
* @return 大小
*/
public static String readableFileSize(File file) {
return readableFileSize(file.length());
}
代码示例来源:origin: looly/hutool
/**
* 可读的文件大小
* @return 大小
*/
public String readableFileSize() {
return FileUtil.readableFileSize(file.length());
}
}
代码示例来源:origin: looly/hutool
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
SystemUtil.append(builder, "Max Memory: ", FileUtil.readableFileSize(getMaxMemory()));
SystemUtil.append(builder, "Total Memory: ", FileUtil.readableFileSize(getTotalMemory()));
SystemUtil.append(builder, "Free Memory: ", FileUtil.readableFileSize(getFreeMemory()));
SystemUtil.append(builder, "Usable Memory: ", FileUtil.readableFileSize(getUsableMemory()));
return builder.toString();
}
}
代码示例来源:origin: looly/hutool
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
SystemUtil.append(builder, "Max Memory: ", FileUtil.readableFileSize(getMaxMemory()));
SystemUtil.append(builder, "Total Memory: ", FileUtil.readableFileSize(getTotalMemory()));
SystemUtil.append(builder, "Free Memory: ", FileUtil.readableFileSize(getFreeMemory()));
SystemUtil.append(builder, "Usable Memory: ", FileUtil.readableFileSize(getUsableMemory()));
return builder.toString();
}
}
代码示例来源:origin: cn.hutool/hutool-all
/**
* 可读的文件大小
*
* @param file 文件
* @return 大小
*/
public static String readableFileSize(File file) {
return readableFileSize(file.length());
}
代码示例来源:origin: cn.hutool/hutool-all
/**
* 可读的文件大小
* @return 大小
*/
public String readableFileSize() {
return FileUtil.readableFileSize(file.length());
}
}
代码示例来源:origin: cn.hutool/hutool-all
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
SystemUtil.append(builder, "Max Memory: ", FileUtil.readableFileSize(getMaxMemory()));
SystemUtil.append(builder, "Total Memory: ", FileUtil.readableFileSize(getTotalMemory()));
SystemUtil.append(builder, "Free Memory: ", FileUtil.readableFileSize(getFreeMemory()));
SystemUtil.append(builder, "Usable Memory: ", FileUtil.readableFileSize(getUsableMemory()));
return builder.toString();
}
}
代码示例来源:origin: cn.hutool/hutool-system
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
SystemUtil.append(builder, "Max Memory: ", FileUtil.readableFileSize(getMaxMemory()));
SystemUtil.append(builder, "Total Memory: ", FileUtil.readableFileSize(getTotalMemory()));
SystemUtil.append(builder, "Free Memory: ", FileUtil.readableFileSize(getFreeMemory()));
SystemUtil.append(builder, "Usable Memory: ", FileUtil.readableFileSize(getUsableMemory()));
return builder.toString();
}
}
内容来源于网络,如有侵权,请联系作者删除!