How to read a file in java – by using FileInputStream
Manohar Changed status to publish July 7, 2019
Use below snippet and try .
public String readFile(String fileWithPath) throws IOException{
FileInputStream inputStream = new FileInputStream(fileWithPath);
String readTotalFile = null;
try {
readTotalFile = IOUtils.toString(inputStream);
}
finally {
inputStream.close();
}
return readTotalFile;
}
Manohar Changed status to publish July 7, 2019
