blob: 34123c53cd50fbf012c6c7e827b57d0a56046ee9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package info.selflearner.ocr_telegram.util;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class FileContentReader {
public static String read(File file) throws IOException {
try(FileReader fileReader = new FileReader(file)) {
StringBuilder content = new StringBuilder();
int nextChar;
while ((nextChar = fileReader.read()) != -1) {
content.append((char) nextChar);
}
return String.valueOf(content);
}
}
}
|