public void readToEnd() { while (!completed) { try { clock.sleepForMillis(100); } catch (InterruptedException ignored) { } } }