private void waitUntilDone() throws InterruptedException {
      if (isClosed() || Thread.interrupted()) {
        throw new InterruptedException();
      }
      synchronized (doneMon) {
        while (data != null) {
          if (isClosed() || Thread.interrupted()) {
            throw new InterruptedException();
          }
          // logit("about to doneMon wait");
          doneMon.wait(); // spurious wakeup ok
          // logit("after doneMon wait");
          if (isClosed() || Thread.interrupted()) {
            throw new InterruptedException();
          }
        }
      }
    }
This input stream waits for data to be available. Once it is provided, by a call to addChunk,
it will stream the data in from that chunk, signal that is has completed, and then wait for
another chunk.
geode-core/src/main/java/org/apache/geode/internal/tcp/MsgDestreamer.java