Midware TMWBuffer.ExpandBuffer

From Overbyte
Jump to navigation Jump to search

Main page -> Midware component reference -> TMWBuffer -> ExpandBuffer

Definition

procedure ExpandBuffer(pSize:PInteger;Requested:Longlnt):Boolean;

Description

ExpandBuffer method check how much free space is left and will try to expand data buffer as needed. If operation is successful then ExpandBuffer returns TRUE. If there is not enough free space available and buffer can't be expanded, then ExpandBuffer will returns FALSE. If buffer is expanded, DataBuffer may change (memory manager will try to keep data at same address as much as possible, data will be copied if buffer has to be moved to another location).

Requested argument specifies how much free space is requested. If less is remaining then buffer will be expanded by the requested value rounded nearest the greater multiple of AutoExpand property value. If AutoExpand is 0, then buffer will not be expanded and function retrun FALSE.

pSize argument must be nil or point to an integer that will receive how much free data space is left after the operation.