System.Classes.TCustomMemoryStream.SetPointer

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure SetPointer(Ptr: Pointer; const Size: NativeInt);

C++

void __fastcall SetPointer(void * Ptr, const NativeInt Size);

Properties

Type Visibility Source Unit Parent
procedure
function
protected
System.Classes.pas
System.Classes.hpp
System.Classes TCustomMemoryStream

Description

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.

See Also