Document streams, implement a_end