Here you can find the source of readBigDecimal(byte valueBytes[], int valueLength, int scale)
static BigDecimal readBigDecimal(byte valueBytes[], int valueLength, int scale)
//package com.java2s; /*/*w w w. jav a 2 s . c o m*/ * Microsoft JDBC Driver for SQL Server * * Copyright(c) Microsoft Corporation All rights reserved. * * This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information. */ import java.math.BigDecimal; import java.math.BigInteger; public class Main { static BigDecimal readBigDecimal(byte valueBytes[], int valueLength, int scale) { int sign = (0 == valueBytes[0]) ? -1 : 1; byte[] magnitude = new byte[valueLength - 1]; for (int i = 1; i <= magnitude.length; i++) magnitude[magnitude.length - i] = valueBytes[i]; return new BigDecimal(new BigInteger(sign, magnitude), scale); } }