Rewrite of the MemoryFile class