Skip to content

IOKit 文件工具类

常用方法

方法名说明
String readToString(String file)读取文件文本内容
String readToString(BufferedReader bufferedReader)读取文件文本内容
String readToString(Path path)读取文件文本内容
String readToString(InputStream input)读取文件文本内容
void copyFile(File source, File dest)本地复制文件
void compressGZIP(File input, File output)gzip 压缩文件,输出到指定路径
byte[] compressGZIP(byte[] data)gzip 压缩字节码,返回新字节码
byte[] compressGZIP(String content)gzip 压缩文本为字节码,默认 utf-8 编码
byte[] compressGZIP(String content, Charset charset)gzip 指定编码压缩文本