diff --git a/kool/src/main/java/org/davidmoten/kool/BufferBuilder.java b/kool/src/main/java/org/davidmoten/kool/BufferBuilder.java index cbbe01c..42a1b81 100644 --- a/kool/src/main/java/org/davidmoten/kool/BufferBuilder.java +++ b/kool/src/main/java/org/davidmoten/kool/BufferBuilder.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.concurrent.Callable; +import org.davidmoten.kool.function.BiConsumer; import org.davidmoten.kool.function.BiFunction; import org.davidmoten.kool.function.BiPredicate; import org.davidmoten.kool.function.Function; @@ -93,6 +94,11 @@ public BuilderHasAccumulator accumulator(BiFunction(b); } + + public BuilderHasAccumulator accumulator(BiConsumer accumulator) { + b.accumulator = (buffer, t) -> {accumulator.accept(buffer, t); return buffer;}; + return new BuilderHasAccumulator(b); + } } public static final class BuilderHasAccumulator {