src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.CUSTOM)
    public final ConnectableObservable<T> replay(final int bufferSize, final long time, final TimeUnit unit, final Scheduler scheduler) {
        ObjectHelper.verifyPositive(bufferSize, "bufferSize");
        ObjectHelper.requireNonNull(unit, "unit is null");
        ObjectHelper.requireNonNull(scheduler, "scheduler is null");
        return ObservableReplay.create(this, time, unit, scheduler, bufferSize);
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.CUSTOM)
    public final ConnectableObservable<T> replay(final int bufferSize, final long time, final TimeUnit unit, final Scheduler scheduler) {
        ObjectHelper.verifyPositive(bufferSize, "bufferSize");
        ObjectHelper.requireNonNull(unit, "unit is null");
        ObjectHelper.requireNonNull(scheduler, "scheduler is null");
        return ObservableReplay.create(this, time, unit, scheduler, bufferSize);
    }
Returns a {@link ConnectableObservable} that shares a single subscription to the source ObservableSource and
that replays a maximum of {@code bufferSize} items that are emitted within a specified time window. A
Connectable ObservableSource resembles an ordinary ObservableSource, except that it does not begin emitting items
when it is subscribed to, but only when its {@code connect} method is called.
<p>
Note that due to concurrency requirements, {@code replay(bufferSize)} may hold strong references to more than
{@code bufferSize} source emissions.
<p>
<img width="640" height="445" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.o.nts.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>You specify which {@link Scheduler} this operator will use.</dd>
</dl>

@param bufferSize
the buffer size that limits the number of items that can be replayed
@param time
the duration of the window in which the replayed items must have been emitted
@param unit
the time unit of {@code time}
@param scheduler
the scheduler that is used as a time source for the window
@return a {@link ConnectableObservable} that shares a single subscription to the source ObservableSource and
replays at most {@code bufferSize} items that were emitted during the window defined by
{@code time}
@throws IllegalArgumentException
if {@code bufferSize} is less than zero
@see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>