Add comments to BlockDeviceInputStream

This commit is contained in:
Davide Depau 2018-12-25 03:00:37 +01:00
parent 2b6c7eb0de
commit e987268ad6
Signed by: depau
GPG key ID: C7D999B6A55EFE86

View file

@ -31,6 +31,7 @@ class BlockDeviceInputStream(
private fun fetch() {
byteBuffer.clear()
// Ensure the buffer is limited on EOF
if (blockDev.size - currentBlockOffset < prefetchBlocks)
byteBuffer.limit(
(blockDev.size - currentBlockOffset).toInt() * blockDev.blockSize