@Test public void testTo() throws Exception { BigInteger result = (BigInteger)typeConverter.to("12147483648".getBytes(StandardCharsets.UTF_8), 0, 11, -1, true); assertEquals(new BigInteger("12147483648"), result); }
@Override public BigInteger to(byte[] bytes, int offset, int length, int decimals, boolean removePadding) { if(this.defaultValue != null && ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { return new BigInteger(defaultValue); } else { return new BigInteger(getIntegerString(bytes, offset, length, removePadding)); } }
IntegerToBigInteger extends IntegerToInteger { @Override public BigInteger to(byte[] bytes, int offset, int length, int decimals, boolean removePadding) { if(this.defaultValue != null && ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { return new BigInteger(defaultValue); } else { return new BigInteger(getIntegerString(bytes, offset, length, removePadding)); } } }
IntegerToBigInteger extends IntegerToInteger { @Override public BigInteger to(byte[] bytes, int offset, int length, int decimals, boolean removePadding) { if(this.defaultValue != null && ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { return new BigInteger(defaultValue); } else { return new BigInteger(getIntegerString(bytes, offset, length, removePadding)); } }  }
IntegerToBigInteger extends IntegerToInteger { @Override public BigInteger to(byte[] bytes, int offset, int length, int decimals, boolean removePadding) { if(this.defaultValue != null && ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { return new BigInteger(defaultValue); } else { return new BigInteger(getIntegerString(bytes, offset, length, removePadding)); } }  @Override void validate(Class<?> type, int size, int decimals); @Override BigInteger to(byte[] bytes, int offset, int length, int decimals, boolean removePadding); @Override byte[] from(Object value, int length, int decimals, boolean addPadding); }
IntegerToBigInteger extends IntegerToInteger { @Override public BigInteger to(byte[] bytes, int offset, int length, int decimals, boolean removePadding) { if(this.defaultValue != null && ByteUtils.allEquals(bytes, this.nullFillerByte, offset, bytes.length)) { return new BigInteger(defaultValue); } else { return new BigInteger(getIntegerString(bytes, offset, length, removePadding)); } }  @Override void validate(Class<?> type, int size, int decimals); @Override BigInteger to(byte[] bytes, int offset, int length, int decimals, boolean removePadding); @Override byte[] from(Object value, int length, int decimals, boolean addPadding);  }