Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
chnmuseum-party
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
748ea544
Commit
748ea544
authored
4 years ago
by
jiawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试 视频上传MD5值不一致时 代码修改
parent
bc9a9107
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
CopyStreamUtils.java
.../java/cn/chnmuseum/party/common/util/CopyStreamUtils.java
+5
-0
No files found.
src/main/java/cn/chnmuseum/party/common/util/CopyStreamUtils.java
View file @
748ea544
package
cn
.
chnmuseum
.
party
.
common
.
util
;
package
cn
.
chnmuseum
.
party
.
common
.
util
;
import
cn.hutool.crypto.digest.MD5
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.InputStream
;
import
java.io.InputStream
;
...
@@ -50,6 +52,7 @@ public class CopyStreamUtils {
...
@@ -50,6 +52,7 @@ public class CopyStreamUtils {
// 更新md5校验码的输入流
// 更新md5校验码的输入流
Md5Utils
.
updateFileMD5String
(
buffer
,
readNum
);
Md5Utils
.
updateFileMD5String
(
buffer
,
readNum
);
// 分段的复制inputStream,每次将新产生的小段流与原来的合并
// 分段的复制inputStream,每次将新产生的小段流与原来的合并
streams
.
add
(
new
ByteArrayInputStream
(
baos
.
toByteArray
()));
streams
.
add
(
new
ByteArrayInputStream
(
baos
.
toByteArray
()));
...
@@ -68,6 +71,8 @@ public class CopyStreamUtils {
...
@@ -68,6 +71,8 @@ public class CopyStreamUtils {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"md5"
,
MD5String
);
map
.
put
(
"md5"
,
MD5String
);
map
.
put
(
"inputStream"
,
sequenceInputStream
);
map
.
put
(
"inputStream"
,
sequenceInputStream
);
// String digestHex16 = MD5.create().digestHex16(inputStream);
// map.put("md5", digestHex16);
return
map
;
return
map
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment