LEAD-196 added intToBytes and bytesToInt.
LEAD-196 when append mode is true, then we must get the last block in the fd, so calculation is correct. and then when maybeRepositionCurrentBlock and then the subsequent algorithm can perform correctly.
LEAD-196 updated test case with assert.
LEAD-196 verified in test case TestCassandraFileOutputStream