mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
update all wireEncode & add packet test: CPacket
This commit is contained in:
1 parent
424d182d60
commit
2bf431af9c
33 files changed
+335
-317
No files matched your search
@@ -30,27 +30,27 @@ public class LpPacket implements IEncodingAble {
|
||||
// 编码 TLV-VALUE
|
||||
// LpHeader
|
||||
int tmpLen = this.lpPacketHeader.wireEncode(encoder);
|
||||
if(tmpLen<=0){
|
||||
if(tmpLen<0){
|
||||
return -1;
|
||||
}
|
||||
totalLength+=tmpLen;
|
||||
// Fragment
|
||||
tmpLen = this.payload.wireEncode(encoder);
|
||||
if(tmpLen<=0){
|
||||
if(tmpLen<0){
|
||||
return -1;
|
||||
}
|
||||
totalLength+=tmpLen;
|
||||
|
||||
// 编码 TLV-LENGTH
|
||||
tmpLen = encoder.prependVarNumber(new VlInt(totalLength));
|
||||
if(tmpLen<=0){
|
||||
if(tmpLen<0){
|
||||
return -1;
|
||||
}
|
||||
totalLength+=tmpLen;
|
||||
|
||||
// 编码 TLV-TYPE
|
||||
tmpLen = encoder.prependVarNumber(new VlInt(TLV.TlvLpPacket));
|
||||
if(tmpLen<=0){
|
||||
if(tmpLen<0){
|
||||
return -1;
|
||||
}
|
||||
totalLength+=tmpLen;
|
||||
|
||||
Reference in new issue
Block a user