Write whole buffer, not half of buffer.