pretend to have a file without loading it from harddrive

How to pretend to have a file without actually loading a file? The challenge is not to create a temporary file or load anything from a harddrive. I would rather like to keep everything in "memory".

In memory means to me having an existing class which derivates from stream initalized and having that class working like it loaded a file from harddrive but it didnt...

Jon Skeet
people
quotationmark

A memory stream isn't a file. It's just data. The concept of setting a filename and extension on a memory stream simply doesn't make sense - any more than it would for a byte[].

people

See more on this question at Stackoverflow