Skip to content

Commit

Permalink
[SPARK-12222][CORE] Deserialize RoaringBitmap using Kryo serializer t…
Browse files Browse the repository at this point in the history
…hrow Buffer underflow exception

Since we only need to implement `def skipBytes(n: Int)`,
code in #10213 could be simplified.
davies scwf

Author: Daoyuan Wang <[email protected]>

Closes #10253 from adrian-wang/kryo.
  • Loading branch information
adrian-wang authored and sarutak committed Dec 28, 2015
1 parent 01ba95d commit a6d3853
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,7 @@ private[serializer] class KryoInputDataInputBridge(input: KryoInput) extends Dat
override def readInt(): Int = input.readInt()
override def readUnsignedShort(): Int = input.readShortUnsigned()
override def skipBytes(n: Int): Int = {
var remaining: Long = n
while (remaining > 0) {
val skip = Math.min(Integer.MAX_VALUE, remaining).asInstanceOf[Int]
input.skip(skip)
remaining -= skip
}
input.skip(n)
n
}
override def readFully(b: Array[Byte]): Unit = input.read(b)
Expand Down

0 comments on commit a6d3853

Please sign in to comment.