/** * Reads the ptg data from the array starting at the specified position * * @param data the RPN array * @param pos the current position in the array, excluding the ptg identifier * @return the number of bytes read */ public int read(byte[] data, int pos) { int index = IntegerHelper.getInt(data[pos], data[pos + 1]); function = Function.getFunction(index); Assert.verify(function != Function.UNKNOWN, "function code " + index); return(2); }
/** * Reads the ptg data from the array starting at the specified position * * @param data the RPN array * @param pos the current position in the array, excluding the ptg identifier * @return the number of bytes read * @exception FormulaException */ public int read(byte[] data, int pos) { arguments = data[pos]; int index = IntegerHelper.getInt(data[pos + 1], data[pos + 2]); function = Function.getFunction(index); if (function == Function.UNKNOWN) { throw new FormulaException(FormulaException.UNRECOGNIZED_FUNCTION, index); } return(3); }