public void addChunk(ByteBuffer bb) throws IOException {
      provideData(bb);
      for (;;) {
        stopper.checkCancelInProgress(null);
        boolean interrupted = Thread.interrupted();
        try {
          waitUntilDone();
          break;
        } catch (InterruptedException e) {
          interrupted = true;
        } finally {
          if (interrupted) {
            Thread.currentThread().interrupt();
          }
        }
      }
    }
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