Class BatchedStreams

java.lang.Object
google.registry.util.BatchedStreams

public final class BatchedStreams extends Object
Utilities for breaking up a Stream into batches.
  • 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.