public static int calculateEncodedLength ( BigDecimal value ) { if ( value == null ) { return 1 ; } return signedVarIntLength ( value . scale ( ) ) + calculateEncodedLength ( value . unscaledValue ( ) ) ; }
Returns the amount of bytes required to encode the given BigDecimal .