public void process(Inverter inverter) throws IOException, SmajavaException, InterruptedException {        
        InputStream inputStream = Engine.class.getResourceAsStream(Configuration.getDataFilename());
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        
        String line;
        byte[] received = null;
        int linecntr = 0;
        int resettedline = 0;
        int tries = 0;
        while ((line = bufferedReader.readLine()) != null) {
            linecntr++;
            if (line.startsWith("S")) {
                send(line);
            } else if (line.startsWith("R")) {
                received = receive(line);
            } else if (line.startsWith("E")) {
                try {
                    extract(line, received);
                } catch (SmajavaException e) {
                    if (e.getType() == SmajavaException.Type.BLUETOOTH_RESET) {
                        tries++;
                        if (tries > MAX_EXTRACTING_RETRIES) {
                            throw e;
                        }
                        bufferedReader.reset();
                        linecntr = resettedline;
                    } else {
                        throw e;
                    }
                }
            } else if (line.startsWith(":")) {
                // mark at this position to return to this point if reads fail
                bufferedReader.mark(2048);
                resettedline = linecntr;
            }    
            Log.info(this, "line: "+linecntr);
        }
        Log.info(this, "The End");
        bufferedReader.close();
    }