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 Link icon

    • toBatches Link icon

      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.