Notice that in Clootie's code the memory for MemAddr is not allocated. You should add "GetMem(MemAddr, Stream.Size)" before reading. Also, there is no possibility to save the texture to stream this way.

As for texture format, you can use GetLevelDesc to retreive information about the texture and its format. Of course, to support multiple texture formats you'll have to write the necessary conversion functions.