public static int encodeDesc ( BigDecimal value , byte [ ] dst , int dstOffset ) { if ( value == null ) { dst [ dstOffset ] = NULL_BYTE_LOW ; return 1 ; } if ( value . signum ( ) == 0 ) { dst [ dstOffset ] = ( byte ) 0x7f ; return 1 ; } return encode ( value ) . copyDescTo ( dst , dstOffset ) ; }
Encodes the given optional BigDecimal into a variable amount of bytes for descending order . If the BigDecimal is null exactly 1 byte is written . Otherwise the amount written can be determined by calling calculateEncodedLength .