no message
Showing
1 changed file
with
2 additions
and
0 deletions
| ... | @@ -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) { | ... | ... |
-
Please register or sign in to post a comment