use offset in mem value
pass backend test
Implemented encoder
refactor code. separate encode, decode, record. Reader and Writer are api for user