add bufferd wrapper for input stream