mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -89,7 +89,7 @@ public class FileReader extends FileWrapper {
|
|||||||
* @throws IORuntimeException IO异常
|
* @throws IORuntimeException IO异常
|
||||||
*/
|
*/
|
||||||
public String readString() throws IORuntimeException{
|
public String readString() throws IORuntimeException{
|
||||||
// TODO JDK11+不再推荐使用这种方式,推荐使用Files.readString
|
// JDK11+不再推荐使用这种方式,推荐使用Files.readString
|
||||||
return new String(readBytes(), this.charset);
|
return new String(readBytes(), this.charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1654,7 +1654,7 @@ public class FileUtil extends PathUtil {
|
|||||||
* @throws IORuntimeException IO异常
|
* @throws IORuntimeException IO异常
|
||||||
*/
|
*/
|
||||||
public static String readString(final File file, final Charset charset) throws IORuntimeException {
|
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异常
|
* @throws IORuntimeException IO异常
|
||||||
*/
|
*/
|
||||||
public static <T extends Collection<String>> T readLines(final File file, final Charset charset, final T collection) throws IORuntimeException {
|
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异常
|
* @throws IORuntimeException IO异常
|
||||||
*/
|
*/
|
||||||
public static void readLines(final File file, final Charset charset, final SerConsumer<String> lineHandler) throws IORuntimeException {
|
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
|
* @since 3.1.1
|
||||||
*/
|
*/
|
||||||
public static <T> T read(final File file, final Charset charset, final SerFunction<BufferedReader, T> readerHandler) throws IORuntimeException {
|
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
|
// endregion
|
||||||
|
|
||||||
@@ -2472,7 +2472,7 @@ public class FileUtil extends PathUtil {
|
|||||||
* @throws IORuntimeException IO异常
|
* @throws IORuntimeException IO异常
|
||||||
*/
|
*/
|
||||||
public static long writeToStream(final File file, final OutputStream out) throws IORuntimeException {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user