Schau die mal TWriter an. Sollte genau das tun was du willst.
Beispiel:
Delphi-Quellcode:
procedure TIrgendwas.SaveToStream(AStream : TStream);
var
Writer : TWriter;
begin
Writer := TWriter.Create(AStream,$10000000);
try
Writer.WriteString('<BEGINVERSION>');
Writer.WriteInteger(majorVer);
Writer.WriteInteger(minorVer);
Writer.WriteString('<ENDVERSION>');
Writer.FlushBuffer;
finally
Writer.Free;
end;
end;