public void run()

in src/main/java/org/apache/maven/shared/utils/cli/StreamPollFeeder.java [56:85]


    public void run() {

        byte[] buf = new byte[BUF_LEN];

        try {
            while (!done) {
                if (input.available() > 0) {
                    int i = input.read(buf);
                    if (i > 0) {
                        output.write(buf, 0, i);
                        output.flush();
                    } else {
                        done = true;
                    }
                } else {
                    synchronized (lock) {
                        if (!done) {
                            lock.wait(100);
                        }
                    }
                }
            }
        } catch (IOException e) {
            exception = e;
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        } finally {
            close();
        }
    }