mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-24 18:04:54 +08:00
fix code
This commit is contained in:
parent
615e1bb27a
commit
96dbdde1e5
@ -89,7 +89,7 @@ public class FileReader extends FileWrapper {
|
||||
* @throws IORuntimeException IO异常
|
||||
*/
|
||||
public String readString() throws IORuntimeException{
|
||||
// TODO JDK11+不再推荐使用这种方式,推荐使用Files.readString
|
||||
// JDK11+不再推荐使用这种方式,推荐使用Files.readString
|
||||
return new String(readBytes(), this.charset);
|
||||
}
|
||||
|
||||
|
@ -1654,7 +1654,7 @@ public class FileUtil extends PathUtil {
|
||||
* @throws IORuntimeException IO异常
|
||||
*/
|
||||
public static String readString(final File file, final Charset charset) throws IORuntimeException {
|
||||
return org.dromara.hutool.core.io.file.FileReader.of(file, charset).readString();
|
||||
return FileReader.of(file, charset).readString();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1747,7 +1747,7 @@ public class FileUtil extends PathUtil {
|
||||
* @throws IORuntimeException IO异常
|
||||
*/
|
||||
public static <T extends Collection<String>> T readLines(final File file, final Charset charset, final T collection) throws IORuntimeException {
|
||||
return org.dromara.hutool.core.io.file.FileReader.of(file, charset).readLines(collection);
|
||||
return FileReader.of(file, charset).readLines(collection);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1878,7 +1878,7 @@ public class FileUtil extends PathUtil {
|
||||
* @throws IORuntimeException IO异常
|
||||
*/
|
||||
public static void readLines(final File file, final Charset charset, final SerConsumer<String> lineHandler) throws IORuntimeException {
|
||||
org.dromara.hutool.core.io.file.FileReader.of(file, charset).readLines(lineHandler);
|
||||
FileReader.of(file, charset).readLines(lineHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1994,7 +1994,7 @@ public class FileUtil extends PathUtil {
|
||||
* @since 3.1.1
|
||||
*/
|
||||
public static <T> T read(final File file, final Charset charset, final SerFunction<BufferedReader, T> readerHandler) throws IORuntimeException {
|
||||
return org.dromara.hutool.core.io.file.FileReader.of(file, charset).read(readerHandler);
|
||||
return FileReader.of(file, charset).read(readerHandler);
|
||||
}
|
||||
// endregion
|
||||
|
||||
@ -2472,7 +2472,7 @@ public class FileUtil extends PathUtil {
|
||||
* @throws IORuntimeException IO异常
|
||||
*/
|
||||
public static long writeToStream(final File file, final OutputStream out) throws IORuntimeException {
|
||||
return org.dromara.hutool.core.io.file.FileReader.of(file).writeToStream(out);
|
||||
return FileReader.of(file).writeToStream(out);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user