Allow buffer size to be specified, ensure buffers are drained before Eof