read and write bytes better