A Real example: mod_txt
mod_txt is a simple output filter module to display plain text files as HTML (or XHTML) with a header and footer. When a text file is requested, it escapes the text as required for HTML, and displays it between the header and the footer.
It works by direct manipulation of buckets (the lowest-level API),
and demonstrates both insertion of file data and substitution of
characters, without any allocation of moving of big blocks.