Delphi has a number of very useful stream classes.
They all derive from TStream.
The basic version is TFileStream – this writes to a filesystem.
There is also THandleStream – this writes to a windows handle – useful if you need to keep a file locked then write to it.
TStringStream is useful when dealing with delphi strings – especially when writing to another stream.
TBlobStream is used for accessing blob data from a database.
TResourceStream is used to read from embedded resources.
TMemoryStream that acts upon blocks of memory.
There are also the adapter streams that takes another stream as a parameter.
There is the TIStream that acts as a bridge between TStreams and the IStreams interface.
These include ZipStreams, EncryptionStreams, SocketStreams &c
These all take the approach that everything looks like a file this massively simplifys code.