public final class BatchedStreams
extends Object
Utilities for breaking up a
Stream
into batches.
-
Method Summary
static <T> Stream<com.google.common.collect.ImmutableList<T>>
Transform a flat
Stream
into a
Stream
of batches.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
toBatches
public static <T>
Stream<com.google.common.collect.ImmutableList<T>> toBatches(Stream<T> stream,
int batchSize)
Transform a flat
Stream
into a
Stream
of batches.
Closing the returned stream does not close the original stream.