public static int calculateEncodedLength ( BigInteger value ) { if ( value == null ) { return 1 ; } int byteCount = ( value . bitLength ( ) >> 3 ) + 1 ; return unsignedVarIntLength ( byteCount ) + byteCount ; }
Returns the amount of bytes required to encode the given BigInteger .