System.Classes.TPointerStream.SetPointer
Delphi
procedure SetPointer(Ptr: Pointer; const Size: NativeInt);
C++
HIDESBASE void __fastcall SetPointer(void * Ptr, const NativeInt Size);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.Classes.pas System.Classes.hpp |
System.Classes | TPointerStream |
Description
Replaces the memory buffer associated with the memory stream.
System.Classes.TPointerStream.SetPointer inherits from System.Classes.TCustomMemoryStream.SetPointer. All content below this line refers to System.Classes.TCustomMemoryStream.SetPointer.
Replaces the memory buffer associated with the memory stream.
Use SetPointer to set the internal memory buffer, Memory, to be the value passed in by Ptr. Size is the number of bytes Ptr points to.
Descendants of TCustomMemoryStream should use SetPointer to associate the memory stream with the memory buffer that holds the data for the memory stream.
Note: SetPointer does not free the existing value of Memory, if any, when it replaces the memory buffer. Descendants of TCustomMemoryStream that use SetPointer to replace the stream's memory pool should free the memory pointed to by the Memory property before calling SetPointer to replace the memory buffer.