Assign the given stream to this message.

@param stream the stream to route this message into
427945
public void addStream(Stream stream) {
        indexSets.add(stream.getIndexSet());
        if (streams.add(stream)) {
            sizeCounter.inc(8);
            if (LOG.isTraceEnabled()) {
                LOG.trace("[Message size update][{}] stream added: {}", getId(), sizeCounter.getCount());
            }
        }
    }
409688
public final void streamIsFlushed(AOStream stream)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "streamIsFlushed", stream);

    // we schedule an asynchronous removal of the persistent data
    synchronized (streamTable)
    {
      String key = SIMPUtils.getRemoteGetKey(stream.getRemoteMEUuid(), stream.getGatheringTargetDestUuid());
      StreamInfo sinfo = streamTable.get(key);
      if ((sinfo != null) && sinfo.streamId.equals(stream.streamId))
      {
        RemovePersistentStream update = null;
        synchronized (sinfo)
        { // synchronized since reading sinfo.item
          update = new RemovePersistentStream(key, sinfo.streamId, sinfo.itemStream, sinfo.item);
        }
        doEnqueueWork(update);
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "streamIsFlushed");
  }
769348
public void assignTo(HttpOutputMessage message) throws IOException {
		Assert.notNull(message, "Message must not be null");
		HttpHeaders headers = message.getHeaders();
		headers.setContentLength(this.data.remaining());
		headers.add(SEQ_HEADER, Long.toString(getSequence()));
		headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
		WritableByteChannel body = Channels.newChannel(message.getBody());
		while (this.data.hasRemaining()) {
			body.write(this.data);
		}
		body.close();
	}
1313381
protected void setStream(
    int priority,
    Reliability reliability,
    Stream stream) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "setStream",
        new Object[] { new Integer(priority), reliability, stream });
        
    ReliabilitySubset subset = getSubset(reliability);    
    subset.setStream(priority, stream);
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "setStream");
  }
1060943
private void copyToStream(String txt, OutputStream stream) throws IOException {
        if (txt != null) {
            stream.write(txt.getBytes());
        }
    }
707136
public static void writeStreamToStream(InputStream input, OutputStream output)
  throws IOException {
    byte[] buffer = new byte[4096];
    while (true) {
      int len = input.read(buffer);
      if (len == -1) {
        break;
      }
      output.write(buffer, 0, len);
    }
  }
327793
public function initializeState(DomainEventStream $stream): void
    {
        foreach ($stream as $message) {
            ++$this->playhead;
            $this->handleRecursively($message->getPayload());
        }
    }
1240284
public static void writeValue(OutputStream stream, Object pojo) throws IOException {
        DataModelSerializer.serializeAsStream(pojo, stream);
    }
1004989
private static void writeStream(final InputStream input, final FileWriter writer)
            throws IOException
    {
        writeStream(input, writer, LineEndingStyle.LOCAL);
    }
1220463
public static void consumeStream(InputStream is) {
        if (is != null) {
            try {
                // Copy the stream to a null destination
                long copied = IOUtils.copyLarge(is, NullOutputStream.NULL_OUTPUT_STREAM);
                if (copied > 0) {
                    logger.log(Level.WARNING, "Consumed unused HTTP response error stream.");
                }
            } catch (IOException ioe) {
                // The stream was probably already closed, there's nothing further we can do anyway
                logger.log(Level.FINEST, "Unable to consume stream.", ioe);
            }
        }
    }
1048847
public <U> SimpleReactStream<U> fromStream(final Stream<CompletableFuture<U>> stream) {

        final Stream s = stream;
        return construct(s);
    }
691421
public void setStreamSegmentId(long value) {
        Preconditions.checkState(this.streamSegmentId == ContainerMetadata.NO_STREAM_SEGMENT_ID, "StreamSegmentId has already been assigned for this operation.");
        Preconditions.checkArgument(value != ContainerMetadata.NO_STREAM_SEGMENT_ID, "Invalid StreamSegmentId");
        this.streamSegmentId = value;
    }
311389
protected final void removeMessage(Http2Stream stream, boolean release) {
        FullHttpMessage msg = stream.removeProperty(messageKey);
        if (release && msg != null) {
            msg.release();
        }
    }
649466
private <T> void manageSubscription(EventStream<T> stream, Consumer<T> consumer) {
        manageSubscription(stream.subscribe(consumer));
    }
392407
public T deserialize(InputStream stream) {
        if (stream == null) {
            throw new RuntimeException("Stream cannot be null");
        } else {
            return deserialize(new StreamSource(stream));
        }
    }
752655
@Override public void onStream(Http2Stream stream) throws IOException {
    stream.close(ErrorCode.REFUSED_STREAM, null);
  }
304902
@Synchronized("lock")
    public void disconnect(final ReactiveSeq<T> stream) {

      Option<Queue<T>> o = streamToQueue.get(stream);

        distributor.removeQueue(streamToQueue.getOrElse(stream, new Queue<>()));
        this.streamToQueue = streamToQueue.remove(stream);
        this.index--;
    }