Skip to content

Commit 23ba459

Browse files
authored
fix(odc-desktop): download size of datasource_template always is 0B (#4471)
* add code * change
1 parent 3d740b9 commit 23ba459

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

server/odc-service/src/main/java/com/oceanbase/odc/service/connection/ConnectionService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,7 @@ public BinaryDataResult getBatchImportTemplateFile() throws IOException {
893893
if (input == null) {
894894
throw new UnexpectedException(DATASOURCE_TEMPLATE_FILE_NAME + " is not found");
895895
}
896-
byte[] buffer = new byte[input.available()];
897-
IOUtils.read(input, buffer);
896+
byte[] buffer = IOUtils.toByteArray(input);
898897
return new ByteArrayDataResult(DATASOURCE_TEMPLATE_FILE_NAME, buffer);
899898
}
900899
}

0 commit comments

Comments
 (0)