I need to use the TMemoryStream class in WEBLib.Utils to save variaous kinds of data such as integers and doubles. In Delphi System.Classes contains the TMemoryStream where to write a value to the stream I would use:
s.write (value, sizeof (value));
where s is the stream and write is declared as
function Write(const Buffer; Count: Longint): Longint;
WebLib.Utils contains the TMemoryStream but does not have the equivalent function, it only has:
function Write(const ABuffer: TBytes; const ACount: Longint): Longint;
What's the approach one should take to use this method? Do I need to declare a variable of type TBytes of the right size, copy the value (using move) into the TBytes variable and call write? Its seems combersome?