05d3b9f4 by chentao

no message

1 parent e73fd642
...@@ -140,6 +140,7 @@ public class CourseController extends BaseController { ...@@ -140,6 +140,7 @@ public class CourseController extends BaseController {
140 byte[] fileBytes = null; 140 byte[] fileBytes = null;
141 try { 141 try {
142 InputStream inputStream = storage.getObjectContent(sysOss.getUrl()); 142 InputStream inputStream = storage.getObjectContent(sysOss.getUrl());
143 log.info("======inputStream===="+inputStream.available());
143 ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); 144 ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
144 byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小 145 byte[] buffer = new byte[8192]; // 或者根据实际情况选择合适的缓冲区大小
145 int bytesRead; 146 int bytesRead;
...@@ -148,6 +149,7 @@ public class CourseController extends BaseController { ...@@ -148,6 +149,7 @@ public class CourseController extends BaseController {
148 } 149 }
149 byteArrayOutputStream.flush(); 150 byteArrayOutputStream.flush();
150 fileBytes = byteArrayOutputStream.toByteArray(); 151 fileBytes = byteArrayOutputStream.toByteArray();
152 log.info("======fileBytes.length===="+fileBytes.length);
151 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes); 153 byte[] encryptBytes = EncryptUtils.encryptByAes(fileBytes);
152 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain"); 154 uploadResult = storage.uploadSuffix(encryptBytes, suffix, "text/plain");
153 } catch (Exception e) { 155 } catch (Exception e) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!