correctly return written bytes for console io