mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
finished component: HopLimit
This commit is contained in:
1 parent
b19477dcf1
commit
9df4cf742a
7 files changed
+99
-7
No files matched your search
@@ -123,10 +123,10 @@ public class TLV {
|
||||
*/
|
||||
public static long readNonNegativeInteger(byte[] buffer,int start,int end){
|
||||
if(start==end){
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
if((start<0)||(end>buffer.length)){
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
int len=end-start;
|
||||
byte[] bytes=new byte[len];
|
||||
@@ -140,7 +140,7 @@ public class TLV {
|
||||
}else if(len==8){
|
||||
return ByteHelper.uint64ToLong(bytes);
|
||||
}else{
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user