Buffer Objects
Forefront TMG handles data in data buffers. Each data buffer is represented by a buffer object. By using pointers to the buffer object, various components, such as a series of filters, can use the same data without the need to copy data. Avoiding copying data improves performance.
A buffer's size is defined in two ways:
- Allocated size
- Actual size
The allocated size is the buffer's capacity in bytes and does not reflect data actually stored in the buffer. When a buffer is created and filled by a filter, it begins with a defined allocated size. The actual size is the number of bytes of data the buffer currently holds.
A filter can perform the following buffer management activities:
- Read into a buffer directly from a memory pointer by using the IFWXIOBuffer::Append method.
- Read a buffer by using the IFWXIOBuffer::GetBufferAndSize method.
- Read a portion of a buffer by using the IFWXIOBuffer::ReadAt method.
- Send data from a buffer to another buffer by using the IFWXIOBuffer::SendToBuffer method.
- Manipulate the memory directly by using the IFWXIOBuffer::GetBufferAndSize method. This operation can only be performed by the buffer owner (the filter that created the buffer).
- Reset the buffer size by using the IFWXIOBuffer::SetDataSize method.
Buffer objects implement the IFWXIOBuffer interface. Using the IFWXIOBuffer interface, information about the buffer can be retrieved, and the buffer can be modified.
Build date: 7/12/2010