rename reader-writer pipe func
rewrite bufwriter