public static BufferedReader
multipartFileToBufferedReader(MultipartFile multipartFile, String charsetName) {
if (multipartFile ==
null || multipartFile.isEmpty()) {
return null;
}
try {
InputStream inputStream = multipartFile.getInputStream();
InputStreamReader inputStreamReader =
new InputStreamReader(inputStream, charsetName);
BufferedReader bufferedReader =
new BufferedReader(inputStreamReader);
return bufferedReader;
}
catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static BufferedReader
multipartFileToBufferedReader(MultipartFile multipartFile) {
return multipartFileToBufferedReader(multipartFile,
"UTF-8");
}