error handle to all: VlIntException

This commit is contained in:
free will committed 2021-03-18 20:12:27 +08:00
1 parent 96650c8f42
commit 30dd00ffb4
5 files changed
+21 -20

No files matched your search

+4 -4
View File
@@ -38,7 +38,7 @@ public class SignatureInfo implements TlvComponentBase, IEncodingAble {
* 根据 TLV Block 创建一个 SignatureInfo
* @param block
*/
public SignatureInfo(Block block){
public SignatureInfo(Block block) throws VlIntException {
this.buildSignatureInfoByBlock(block);
}
@@ -74,7 +74,7 @@ public class SignatureInfo implements TlvComponentBase, IEncodingAble {
* @param block
* @return
*/
public boolean buildSignatureInfoByBlock(Block block){
public boolean buildSignatureInfoByBlock(Block block) throws VlIntException {
return this.wireDecode(block);
}
@@ -127,7 +127,7 @@ public class SignatureInfo implements TlvComponentBase, IEncodingAble {
// 编码 TLV-TYPE
tmplen=encoder.prependVarNumber(new VlInt(TLV.TlvSignatureInfo));
if(tmplen<=0){
return 0;
return -1;
}
totalLength+=tmplen;
@@ -140,7 +140,7 @@ public class SignatureInfo implements TlvComponentBase, IEncodingAble {
* @return
*/
@Override
public boolean wireDecode(Block block) {
public boolean wireDecode(Block block) throws VlIntException {
// 检查 Type 是否正确
if(!TLV.expectType(block.getType(),new VlInt(TLV.TlvSignatureInfo))){
return false;