To stream stream.

@param <T> the type parameter
@param opt the opt
@return the stream
356932
public static <T> Stream<T> toStream(Optional<T> opt) {
    return Arrays.asList(opt.orElse(null)).stream().filter(y -> null != y);
  }
1243734
function createStringifyStream(opts) {
    assert.object(opts, 'opts');
    assert.ok(Array.isArray(opts.body) || typeof opts.body === 'object',
        'opts.body must be an array or object');

    return stringifyStreamFactory(opts.body, null, null, true);
}
849139
function Stream(options) {

  /**
   * Whether or not the Stream was initialized as
   * a single- or multi-key stream.
   *
   * @property multi
   * @type Boolean
   */
  reader(this, 'multi', !(options && options.apiKey));

  if (!this.multi) {
    options.headers = options.headers || {};
    options.headers['Zotero-API-Key'] = options.apiKey;

    delete options.apiKey;
  }

  Client.call(this, options);

  /**
   * @property retry
   * @type Object
   */
  reader(this, 'retry', {
    delay: Stream.DEFAULT_RETRY
  });

  /**
   * @property idle
   * @type Object
   */
  reader(this, 'idle', {
    ping: Stream.IDLE_TIMEOUT,
    pong: Stream.IDLE_TIMEOUT / 2
  });

  /**
   * @property subscriptions
   * @type Subscriptions
   */
  this.subscriptions = new Subscriptions();

  this.open = this.open.bind(this);
  this.opened = this.opened.bind(this);
  this.closed = this.closed.bind(this);
  this.ping = this.ping.bind(this);
  this.pong = this.pong.bind(this);
  this.receive = this.receive.bind(this);
  this.error = this.error.bind(this);

  this.open();
}
115615
protected <T> Stream<T> streamOfType(BeanResolutionContext resolutionContext, Class<T> beanType, Qualifier<T> qualifier) {
        return getBeansOfTypeInternal(resolutionContext, beanType, qualifier).stream();
    }
849417
public <T> Stream<T> stream( Publisher pub, int batchSize ) {
        return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator(pub, batchSize), Spliterator.IMMUTABLE | Spliterator.NONNULL), false);
    }
227439
function streamFactory( options ) {
		if ( !arguments.length ) {
			options = {};
		}
		options = copyOptions( options );
		/**
		* FUNCTION: createStream( arr )
		*	Creates a stream.
		*
		* @param {Array} arr - array to convert into a readable stream
		* @returns {Stream} Readable stream
		*/
		return function createStream( arr ) {
			return new Stream( arr, options );
		};
	}
596763
function Stream( arr, options ) {
		if ( !Array.isArray( arr ) ) {
			throw new TypeError( 'Stream()::invalid input argument. First argument must be an array.' );
		}
		if ( arguments.length < 2 ) {
			options = {};
		}
		if ( !( this instanceof Stream ) ) {
			return new Stream( arr, options );
		}
		var err = validate( options );
		if ( err ) {
			throw err;
		}
		setOptions( options );
		Readable.call( this, options );
		this._array = arr.slice();
		this._destroyed = false;
		this._enc = options.encoding;
		this._mode = options.objectMode;
		return this;
	}
950391
@Override
    public StreamT<W,T> dropUntil(final Predicate<? super T> p) {

        return (StreamT<W,T>) FoldableTransformerSeq.super.dropUntil(p);
    }
121681
public static Stream<?> buildStream(Object object) {
        if (object instanceof Collection)
            return ((Collection<?>) object).stream();
        else if (object.getClass().isArray())
            return Arrays.stream((Object[]) object);
        else
            return Stream.of(object);
    }
120483
private String typeParameters(Options opt, ParameterizedType t) {
	if (t == null)
	    return "";
	StringBuffer tp = new StringBuffer(1000).append("&lt;");
	Type args[] = t.typeArguments();
	for (int i = 0; i < args.length; i++) {
	    tp.append(type(opt, args[i], true));
	    if (i != args.length - 1)
		tp.append(", ");
	}
	return tp.append("&gt;").toString();
    }
735316
public static <T> Stream<T> buildStream(Enumeration<T> enumeration) {
        return buildStream(new Iterator<T>() {
            @Override
            public boolean hasNext() {
                return enumeration.hasMoreElements();
            }

            @Override
            public T next() {
                return enumeration.nextElement();
            }
        });
    }
827937
private String parameter(Options opt, Parameter p[]) {
	StringBuilder par = new StringBuilder(1000);
	for (int i = 0; i < p.length; i++) {
	    par.append(p[i].name() + typeAnnotation(opt, p[i].type()));
	    if (i + 1 < p.length)
		par.append(", ");
	}
	return par.toString();
    }
1204902
public IntStream stream()
    {
        IntStream.Builder builder = IntStream.builder();
        forEach(builder);
        return builder.build();
    }
1159585
public OutputStream getStreamAt(int index) {
		if(index < streams.size()) {
			int i = 0;
			for(Entry<OutputStream, Boolean> entry : streams.entrySet()) {
				if(i++ == index) {
					return entry.getKey();
				}
			}
		}
		return null;
	}
479778
public static <ReqT, RespT> StreamObserver<ReqT> asyncBidiStreamingCall(
      ClientCall<ReqT, RespT> call, StreamObserver<RespT> responseObserver) {
    return asyncStreamingRequestCall(call, responseObserver, true);
  }
1316240
@Override
  public StreamImpl stream()
    throws IOException
  {
    if (_stream == null) {
      _stream = new JniStream(this);
    }

    _stream.init();

    return _stream;
  }
431490
@SuppressWarnings("rawtypes")
    public static <T, R> Collector<T, ?, R> streaming(final Function<? super Stream<T>, R> streamingCollector) {
        return streaming((Supplier) queueSupplier, streamingCollector);
    }