code: 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);
      }
docs: 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.
  
  <p><i>Note:</i> It is recommended that value be normalized by stripping
  trailing zeros. This makes searching by value much simpler.
  
  @param value BigDecimal value to encode, may be null
  @param dst destination for encoded bytes
  @param dstOffset offset into destination array
  @return amount of bytes written
  @since 1.2