code: public long registerStream(String appId, Iterator<ManagedBuffer> buffers, Channel channel) {
      long myStreamId = nextStreamId.getAndIncrement();
      streams.put(myStreamId, new StreamState(appId, buffers, channel));
      return myStreamId;
    }
docs: Registers a stream of ManagedBuffers which are served as individual chunks one at a time to
  callers. Each ManagedBuffer will be release()'d after it is transferred on the wire. If a
  client connection is closed before the iterator is fully drained, then the remaining buffers
  will all be release()'d.
  
  If an app ID is provided, only callers who've authenticated with the given app ID will be
  allowed to fetch from this stream.
  
  This method also associates the stream with a single client connection, which is guaranteed
  to be the only reader of the stream. Once the connection is closed, the stream will never
  be used again, enabling cleanup by `connectionTerminated`.