File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/main/scala/ldbc/snb/datagen/generator/serializers Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import ldbc.snb.datagen.io.raw.RecordOutputStream
9
9
import ldbc .snb .datagen .model .raw
10
10
import org .javatuples .{Pair , Triplet }
11
11
12
+ import java .util .function .Consumer
12
13
import java .util .stream .Stream
13
14
import scala .collection .JavaConverters ._
14
15
@@ -207,10 +208,9 @@ class ActivityOutputStream(
207
208
}
208
209
209
210
object ActivityOutputStream {
210
-
211
- // do this implicitly to make the syntax terser
212
- import scala .language .implicitConversions
213
- implicit private def javaStreamToScalaIterator [T ](t : Stream [T ]): Iterator [T ] = {
214
- t.iterator().asScala
211
+ implicit final class ScalaLoopSupportForJavaStream [A ](val self : Stream [A ]) extends AnyVal {
212
+ def foreach [U ](fn : A => U ): Unit = {
213
+ self.forEach(new Consumer [A ] { override def accept (t : A ): Unit = fn(t) })
214
+ }
215
215
}
216
216
}
You can’t perform that action at this time.
0 commit comments