Do the same with writeByteArray