Skip to main content

文件工具类

class FileUtils

描述: 用于读取文件的文件实用程序类,以 MD5 转换或将十六进制代码添加到字符串

method md5sum

public static synchronized String md5sum(File file)

描述: 将文件转换为 MD5 文本

输入参数: file: 文件路径。

输出参数: 返回一个字符串值。

相关参数: 无。

method toHexString

private static synchronized String toHexString(byte[] b)

描述: 字节的十六进制代码转换

输入参数: b: 文件的字节数据。

输出参数: 返回一个字符串值。

相关参数: 无。

method readFileToString

public static String readFileToString(String path)

描述: 读取本地文件转字符串。

输入参数: path: 字符串形式的文件路径。

输出参数: 返回一个字符串值。

相关参数: 无。

method getMD5

public static String getMD5(String s)

描述: 检索MD5数据。

输入参数: s:MD5字符串。

输出参数: 返回一个字符串值。

相关参数: 无。