public static BigDecimal toBigDecimal(byte[] bytes,int offset,final int length){
  if (bytes == null || length < SIZEOF_INT + 1 || (offset + length > bytes.length)) {
    return null;
  }
  int scale=toInt(bytes,offset);
  byte[] tcBytes=new byte[length - SIZEOF_INT];
  System.arraycopy(bytes,offset + SIZEOF_INT,tcBytes,0,length - SIZEOF_INT);
  return new BigDecimal(new BigInteger(tcBytes),scale);
}

public static BigDecimal toBigDecimal ( byte [ ] bytes , int offset , final int length ) { if ( bytes == null || length < SIZEOF_INT + 1 || ( offset + length > bytes . length ) ) { return null ; } int scale = toInt ( bytes , offset ) ; byte [ ] tcBytes = new byte [ length - SIZEOF_INT ] ; System . arraycopy ( bytes , offset + SIZEOF_INT , tcBytes , 0 , length - SIZEOF_INT ) ; return new BigDecimal ( new BigInteger ( tcBytes ) , scale ) ; }
converts a byte array to a bigdecimal value
