replace "IStateReader" with "BinaryReader", and "IStateWriter" with "BinaryWriter"