Implement outputing to a output stream or writer.