dynamic buffer allocation in PipeWriter