public BigDecimal readDecimal(int precision, int scale) throws IOException {
        BigDecimal v;

        if (precision <= ClickHouseDataType.Decimal32.getMaxScale()) {
            return BigDecimal.valueOf(readIntLE(), scale);
        } else if (precision <= ClickHouseDataType.Decimal64.getMaxScale()) {
            v = BigDecimal.valueOf(readLongLE(), scale);
        } else if (precision <= ClickHouseDataType.Decimal128.getMaxScale()) {
            v = new BigDecimal(readBigIntegerLE(INT128_SIZE, false), scale);
        } else {
            v = new BigDecimal(readBigIntegerLE(INT256_SIZE, false), scale);
        }
        return v;
    }
Reads a decimal value from the internal input stream.
@param precision - precision of the decimal value
@param scale - scale of the decimal value
@return decimal value
@throws IOException when IO error occurs
client-v2/src/main/java/com/clickhouse/client/api/data_formats/internal/BinaryStreamReader.java