Use only one writeBytes call