mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-06-18 04:50:25 +08:00
fixed VlInt.getVlInt()
This commit is contained in:
@@ -136,14 +136,11 @@ public class VlInt {
|
||||
}
|
||||
|
||||
/**
|
||||
* 将vlint转为一个biginteger输出:需要判断size是不是等于9(9)
|
||||
* 将vlint转为一个biginteger输出
|
||||
* @return
|
||||
*/
|
||||
public BigInteger getVlIntValue(){
|
||||
if(this.size()>=9){
|
||||
return VlIntValue;
|
||||
}
|
||||
return null;
|
||||
return this.VlIntValue;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -268,8 +265,12 @@ public class VlInt {
|
||||
|
||||
// 测试
|
||||
public static void main(String[] args){
|
||||
BigInteger bigInteger=new BigInteger("3");
|
||||
VlInt vlInt=new VlInt(bigInteger);
|
||||
System.out.println(vlInt.isEqual(2));
|
||||
// BigInteger bigInteger=new BigInteger("3");
|
||||
// VlInt vlInt=new VlInt(bigInteger);
|
||||
// System.out.println(vlInt.isEqual(2));
|
||||
byte[] b1 = new byte[]{(byte) 0xf1,0x00,0x7f};//241,0,127
|
||||
VlInt start1 = new VlInt(b1);
|
||||
System.out.println("VlIntBytes:"+start1.getVlIntBytes().length);
|
||||
System.out.println("VlIntValue:"+start1.getVlIntValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@ package packet;
|
||||
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
|
||||
*/
|
||||
public class Packet {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public class VlIntTest {
|
||||
// public void createVlIntByBigInteger() {
|
||||
// }
|
||||
|
||||
|
||||
@Test
|
||||
public void getVlIntBytes() {
|
||||
byte[] a = new byte[]{1,2,3,4};
|
||||
|
||||
Reference in New Issue
Block a user