/** * 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) { options = data[pos]; word = IntegerHelper.getInt(data[pos + 1], data[pos + 2]); if (!isChoose()) { return 3; } // word contains the number of jumps by index. // and there is an additional final jump to the choose function itself. return 3 + (word + 1) * 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 */ public int read(byte[] data, int pos) { options = data[pos]; word = IntegerHelper.getInt(data[pos + 1], data[pos + 2]); if (!isChoose()) { return 3; } // word contains the number of jumps by index. // and there is an additional final jump to the choose function itself. return 3 + (word + 1) * 2; }