public EncodedSnmpVariable encode() {
   return EncodedSnmpVariable.newFromTypeAndValue(this.snmpType, this.value.toByteArray());
 }
 public static SnmpGenericNumber newFromEncodedSnmpVariable(SnmpType t, EncodedSnmpVariable tlv) {
   if (tlv.getSnmpType() != t) {
     throw new Error("The type specified in the encoded variable is not the expected type");
   }
   return new SnmpGenericNumber(tlv);
 }
 protected SnmpGenericNumber(EncodedSnmpVariable tlv) {
   this.value = new BigInteger(tlv.getValueAsByteArray());
   this.snmpType = tlv.getSnmpType();
 }