Skip to content

Commit 4686e30

Browse files
retronymadriaanm
authored andcommitted
Override the bulk version of read for efficiency
1 parent 4681dbd commit 4686e30

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/compiler/scala/tools/nsc/symtab/classfile/ReusableDataReader.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ final class ReusableDataReader() extends DataReader {
2727
} catch {
2828
case _: BufferUnderflowException => -1
2929
}
30+
31+
override def read(b: Array[Byte], off: Int, len: Int): Int = {
32+
val pos = bb.position()
33+
bb.get(b, off, len)
34+
bb.position() - pos
35+
}
36+
3037
override def markSupported(): Boolean = false
3138
}
3239
new DataInputStream(stream)

0 commit comments

Comments
 (0)