src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U, V> Observable<Observable<T>> window(
            ObservableSource<U> openingIndicator,
            Function<? super U, ? extends ObservableSource<V>> closingIndicator, int bufferSize) {
        ObjectHelper.requireNonNull(openingIndicator, "openingIndicator is null");
        ObjectHelper.requireNonNull(closingIndicator, "closingIndicator is null");
        ObjectHelper.verifyPositive(bufferSize, "bufferSize");
        return RxJavaPlugins.onAssembly(new ObservableWindowBoundarySelector<T, U, V>(this, openingIndicator, closingIndicator, bufferSize));
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U, V> Observable<Observable<T>> window(
            ObservableSource<U> openingIndicator,
            Function<? super U, ? extends ObservableSource<V>> closingIndicator, int bufferSize) {
        ObjectHelper.requireNonNull(openingIndicator, "openingIndicator is null");
        ObjectHelper.requireNonNull(closingIndicator, "closingIndicator is null");
        ObjectHelper.verifyPositive(bufferSize, "bufferSize");
        return RxJavaPlugins.onAssembly(new ObservableWindowBoundarySelector<T, U, V>(this, openingIndicator, closingIndicator, bufferSize));
    }
Returns an Observable that emits windows of items it collects from the source ObservableSource. The resulting
ObservableSource emits windows that contain those items emitted by the source ObservableSource between the time when
the {@code openingIndicator} ObservableSource emits an item and when the ObservableSource returned by
{@code closingIndicator} emits an item.
<p>
<img width="640" height="550" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window2.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>This version of {@code window} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <U> the element type of the window-opening ObservableSource
@param <V> the element type of the window-closing ObservableSources
@param openingIndicator
an ObservableSource that, when it emits an item, causes another window to be created
@param closingIndicator
a {@link Function} that produces an ObservableSource for every window created. When this ObservableSource
emits an item, the associated window is closed and emitted
@param bufferSize
the capacity hint for the buffer in the inner windows
@return an Observable that emits windows of items emitted by the source ObservableSource that are governed by
the specified window-governing ObservableSources
@see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>