MultipartFile转InputStreamReader BufferedReader

xiaoxiao2021-02-28  18

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"); }
转载请注明原文地址: https://www.6miu.com/read-2050195.html

最新回复(0)