fixed api, output stream support