(String path)
| 51 | |
| 52 | |
| 53 | public void readFile(String path){ |
| 54 | //读文件 |
| 55 | File file = new File(path); |
| 56 | byte[] bytes = getContent(file); |
| 57 | //将文件内容转化为base64编码 |
| 58 | this.content = Base64.getEncoder().encodeToString(bytes); |
| 59 | } |
| 60 | |
| 61 | public void readFile(InputStream inputStream) { |
| 62 | byte[] bytes = getContent(inputStream); |
no test coverage detected