Add comments to BlockDeviceInputStream
This commit is contained in:
parent
2b6c7eb0de
commit
e987268ad6
1 changed files with 1 additions and 0 deletions
|
@ -31,6 +31,7 @@ class BlockDeviceInputStream(
|
||||||
private fun fetch() {
|
private fun fetch() {
|
||||||
byteBuffer.clear()
|
byteBuffer.clear()
|
||||||
|
|
||||||
|
// Ensure the buffer is limited on EOF
|
||||||
if (blockDev.size - currentBlockOffset < prefetchBlocks)
|
if (blockDev.size - currentBlockOffset < prefetchBlocks)
|
||||||
byteBuffer.limit(
|
byteBuffer.limit(
|
||||||
(blockDev.size - currentBlockOffset).toInt() * blockDev.blockSize
|
(blockDev.size - currentBlockOffset).toInt() * blockDev.blockSize
|
||||||
|
|
Loading…
Reference in a new issue