TManagedMemory
While streams are perfect for sequential reading and writing, sometimes you need direct, random access to a block of memory. In traditional Pascal, you might use AllocMem to get a pointer to a block of memory and then write data to specific offsets.
In Quartex Pascal, the class for this is TManagedMemory.
TManagedMemory is a Pascal-friendly wrapper around JavaScript's high-performance JArrayBuffer. It gives you a "Delphi-like" feel for managing a raw block of bytes, similar to a dynamic memory segment or a TBytes array, but with a much more powerful API.
It is the fundamental class used inside TQTXMemoryStream to hold the stream's data. You can use it directly whenever you need to build, parse, or manipulate a binary data packet in memory before sending it.