TStream is an abstract class, which means that you'll have to use a TMemoryStream instead