How long to store data?

Pseudo code.

During "reading" value is compared against previous offset. No value is stored. Only offset.

Questions and answers fill in the blanks.