GetActiveBufferSize


The GetActiveBufferSize method returns size of active buffer. Active buffer size specifies how much file data is buffered internally.
C++
long GetActiveBufferSize(void);
BASIC
GetActiveBufferSize() As Long

Parameters

Method has no parameters.

Return Values

If the method succeeds, the return value is the size of active buffer.
If the method fails, the return value is failure code and error code is set. Call GetError to get error code.

Remarks

Active buffer size determines what part of internal data buffer is used in read and write operations; in other words it specifies how much file data is buffered internally. Developers can optimize application performance by adaptively changing active buffer size according to the size of data being accessed. This feature is especially useful if file is accessed randomly rather than sequentially - for example when reading many small blocks of data from various file positions. By default entire data buffer is used - its size is specified when Initialize method is called.

If size of active buffer is 0 data transfer is unbuffered. On read operations exact number of bytes (according to size of data) is read from file and returned to user; on write operations user data is immediately written to file. Internal data buffer always stays empty - no data is read ahead nor buffered.

Active buffer size is reset to its default value whenever new file is opened or attached to the object, so it should be changed after opening or attaching file.

See Also

SetActiveBufferSize, GetBufferSize, GetBlockSize, Initialize, Reading and Writing Data