Commit d8d384ea authored by John Zhang's avatar John Zhang

fix: check return value from read, iteratively read bytes into buffer

parent bc578970
...@@ -413,7 +413,10 @@ class AlignedInputStream(is: InputStream) extends Closeable { ...@@ -413,7 +413,10 @@ class AlignedInputStream(is: InputStream) extends Closeable {
} }
private def transfer(addr: Long, size: Int): Unit = { private def transfer(addr: Long, size: Int): Unit = {
is.read(buffer, 0, size) var actual = is.read(buffer, 0, size)
while (actual < size) {
actual += is.read(buffer, actual, size - actual)
}
NativeSupport.theMemory.put(addr, buffer, 0, size) NativeSupport.theMemory.put(addr, buffer, 0, size)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment