Commit 4c28f380aa454ce741173a369fb87fa1554c9388
1 parent
94a0de0d
优化byte数组转换
Showing
2 changed files
with
8 additions
and
2 deletions
pom.xml
| ... | ... | @@ -207,6 +207,12 @@ |
| 207 | 207 | <version>2.1.3</version> |
| 208 | 208 | </dependency> |
| 209 | 209 | |
| 210 | + <dependency> | |
| 211 | + <groupId>com.google.guava</groupId> | |
| 212 | + <artifactId>guava</artifactId> | |
| 213 | + <version>20.0</version> | |
| 214 | + </dependency> | |
| 215 | + | |
| 210 | 216 | <!-- json解析库fastjson2 --> |
| 211 | 217 | <dependency> |
| 212 | 218 | <groupId>com.alibaba.fastjson2</groupId> | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java
| ... | ... | @@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request; |
| 3 | 3 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 4 | 4 | import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; |
| 5 | 5 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 6 | +import com.google.common.primitives.Bytes; | |
| 6 | 7 | import gov.nist.javax.sip.message.SIPRequest; |
| 7 | 8 | import gov.nist.javax.sip.message.SIPResponse; |
| 8 | 9 | import org.apache.commons.lang3.ArrayUtils; |
| ... | ... | @@ -196,8 +197,7 @@ public abstract class SIPRequestProcessorParent { |
| 196 | 197 | result.add(rawContent[i]); |
| 197 | 198 | } |
| 198 | 199 | } |
| 199 | - Byte[] bytes = new Byte[0]; | |
| 200 | - byte[] bytesResult = ArrayUtils.toPrimitive(result.toArray(bytes)); | |
| 200 | + byte[] bytesResult = Bytes.toArray(result); | |
| 201 | 201 | |
| 202 | 202 | Document xml; |
| 203 | 203 | try { | ... | ... |