Document stream handler.