io: skip empty strings in write methods