code: static public BigDecimal bytesToBigDecimal(byte[] buffer, int index) {
          int scale = bytesToInt(buffer, index);
          index += 4;
          int precision = bytesToInt(buffer, index);
          index += 4;
          BigInteger intVal = bytesToBigInteger(buffer, index);
          return new BigDecimal(intVal, scale, new MathContext(precision));
      }
docs: This function converts the bytes in a byte array at the specified index to its
  corresponding big decimal value.
  
  @param buffer The byte array containing the big decimal.
  @param index The index for the first byte in the byte array.
  @return The corresponding big decimal value.