simplify buffer
rewrite buffer without stream