fix(测试跟踪): 修改文件流关闭

This commit is contained in:
fit2-zhao 2020-09-17 18:43:29 +08:00
parent a13c3b2de3
commit 5374525783
1 changed files with 1 additions and 2 deletions

View File

@ -331,9 +331,8 @@ public class TestCaseService {
public void download(HttpServletResponse res) throws IOException {
// 发送给客户端的数据
byte[] buff = new byte[1024];
InputStream is = TestCaseService.class.getResourceAsStream("/io/metersphere/xmind/template/testcase.xml");
try (OutputStream outputStream = res.getOutputStream();
BufferedInputStream bis = new BufferedInputStream(is);) {
BufferedInputStream bis = new BufferedInputStream(TestCaseService.class.getResourceAsStream("/io/metersphere/xmind/template/testcase.xml"));) {
int i = bis.read(buff);
while (i != -1) {
outputStream.write(buff, 0, buff.length);