def pos_to_block(pos, len)
      startBlock, startByte = pos.divmod(@sb.blockSize)
      endBlock, endByte = (pos + len - 1).divmod(@sb.blockSize)
      nblocks = endBlock - startBlock + 1
      return startBlock, startByte, endBlock, endByte, nblocks
    end
def pos_to_block(pos, len)
      startBlock, startByte = pos.divmod(@sb.blockSize)
      endBlock, endByte = (pos + len - 1).divmod(@sb.blockSize)
      nblocks = endBlock - startBlock + 1
      return startBlock, startByte, endBlock, endByte, nblocks
    end
NB: pos is 0-based, while len is 1-based