read from TMemoryBuffer object immediately after writing to it

@lxyu