add buffered and block input output function