Do not write 0 bytes if we have noting to write