@Override
        public void run() {
            try {
                output = new BufferedOutputStream(new FileOutputStream(file));
                closed=false;
                run=true;
            } catch (FileNotFoundException ex) {
                Logger.getLogger(ProcessData.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            while(run) {
                if (!close) {
                    writeByte();
                }
                else if (!closed) {
                    while(!fifo.isEmpty()) {
                        writeByte();
                    }
                    close(true);
                }
            }
        }