fix an incorrect unit test
improve the design of SegmentalByteBuffer
update unit test case
fix a bug of SegmentalByteBuffer: if its content changes, we should update the buffer size