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
1 changed files with 1 additions and 0 deletions

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