Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

StreamToVariant

5 views
Skip to first unread message

Roman Kaßebaum

unread,
Jul 27, 2005, 4:22:16 AM7/27/05
to
Hi,

I have a small question: I want to convert a stream to a Variant. Under
Win32 i have written a small function for this:

class function TVarFunc.StreamToVariant(const AStream: TStream): Variant;
begin
Result := VarArrayCreate([0, AStream.Size - 1], varByte);
AStream.Position := 0;
AStream.ReadBuffer(TVarData(Result).VArray^.Data^,
TVarData(Result).VArray^.Bounds[0].ElementCount);
end;

How can I manage this under .net?

--
Roman

Stefanidis Dimitris

unread,
Jul 29, 2005, 10:15:41 AM7/29/05
to
Did you tried aStream.ToArray ??????
wich array is array of bytes ????


Distef


"Roman Kaßebaum" <roman.kass...@kdv-dt.de> wrote in message
news:42e74349$1...@newsgroups.borland.com...

0 new messages