public static BigDecimal decodeNumericAsBigDecimal(PositionedByteRange src) {
    if (isNull(src)) {
      src.get();
      return null;
    }
    if (!isNumeric(src)) throw unexpectedHeader(src.peek());
    if (isNumericNaN(src)) throw unexpectedHeader(src.peek());
    if (isNumericInfinite(src)) throw unexpectedHeader(src.peek());
    return decodeNumericValue(src);
  }
Decode a {@link BigDecimal} value from the variable-length encoding.
@throws IllegalArgumentException when the encoded value is not a Numeric.
@see #encodeNumeric(PositionedByteRange, BigDecimal, Order)
hbase-common/src/main/java/org/apache/hadoop/hbase/util/OrderedBytes.java