class BigDecimalCoder extends AtomicCoder<BigDecimal> {

  @Override
  protected long getEncodedElementByteSize(BigDecimal value) throws Exception {
    checkNotNull(value, String.format("cannot encode a null %s", BigDecimal.class.getSimpleName()));
    return VAR_INT_CODER.getEncodedElementByteSize(value.scale())
        + BIG_INT_CODER.getEncodedElementByteSize(value.unscaledValue());
  }

  private  BigDecimalCoder();

}