src/main/java/io/reactivex/Flowable.java
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.FULL)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U extends Collection<? super T>> Flowable<U> buffer(int count, int skip, Callable<U> bufferSupplier) {
        ObjectHelper.verifyPositive(count, "count");
        ObjectHelper.verifyPositive(skip, "skip");
        ObjectHelper.requireNonNull(bufferSupplier, "bufferSupplier is null");
        return RxJavaPlugins.onAssembly(new FlowableBuffer<T, U>(this, count, skip, bufferSupplier));
    }
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.FULL)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U extends Collection<? super T>> Flowable<U> buffer(int count, int skip, Callable<U> bufferSupplier) {
        ObjectHelper.verifyPositive(count, "count");
        ObjectHelper.verifyPositive(skip, "skip");
        ObjectHelper.requireNonNull(bufferSupplier, "bufferSupplier is null");
        return RxJavaPlugins.onAssembly(new FlowableBuffer<T, U>(this, count, skip, bufferSupplier));
    }
@ CheckReturnValue @ NonNull @ BackpressureSupport ( BackpressureKind . FULL ) @ SchedulerSupport ( SchedulerSupport . NONE ) public final < U extends Collection < ? super T > > Flowable < U > buffer ( int count , int skip , Callable < U > bufferSupplier ) { ObjectHelper . verifyPositive ( count , "count" ) ; ObjectHelper . verifyPositive ( skip , "skip" ) ; ObjectHelper . requireNonNull ( bufferSupplier , "bufferSupplier is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableBuffer < T , U > ( this , count , skip , bufferSupplier ) ) ; }
Returns a Flowable that emits buffers of items it collects from the source Publisher. The resulting
Publisher emits buffers every {@code skip} items, each containing {@code count} items. When the source
Publisher completes, the resulting Publisher emits the current buffer and propagates the notification from the
source Publisher. Note that if the source Publisher issues an onError notification the event is passed on
immediately without first emitting the buffer it is in the process of assembling.
<p>
<img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer4.png" alt="">
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator honors backpressure from downstream and expects the source {@code Publisher} to honor it as
well, although not enforced; violation <em>may</em> lead to {@code MissingBackpressureException} somewhere
downstream.</dd>
<dt><b>Scheduler:</b></dt>
<dd>This version of {@code buffer} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <U> the collection subclass type to buffer into
@param count
the maximum size of each buffer before it should be emitted
@param skip
how many items emitted by the source Publisher should be skipped before starting a new
buffer. Note that when {@code skip} and {@code count} are equal, this is the same operation as
{@link #buffer(int)}.
@param bufferSupplier
a factory function that returns an instance of the collection subclass to be used and returned
as the buffer
@return a Flowable that emits buffers for every {@code skip} item from the source Publisher and
containing at most {@code count} items
@see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
Returns a Flowable that emits buffers of items it collects from the source Publisher . The resulting Publisher emits buffers every { @code skip } items each containing { @code count } items . When the source Publisher completes the resulting Publisher emits the current buffer and propagates the notification from the source Publisher . Note that if the source Publisher issues an onError notification the event is passed on immediately without first emitting the buffer it is in the process of assembling . <p > <img width = 640 height = 320 src = https : // raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / buffer4 . png alt = > <dl > <dt > <b > Backpressure : < / b > < / dt > <dd > The operator honors backpressure from downstream and expects the source { @code Publisher } to honor it as well although not enforced ; violation <em > may< / em > lead to { @code MissingBackpressureException } somewhere downstream . < / dd > <dt > <b > Scheduler : < / b > < / dt > <dd > This version of { @code buffer } does not operate by default on a particular { @link Scheduler } . < / dd > < / dl >