use bufferwriter