While loop exits too early and misses writing remaining bytes. Also restructured the loop itself to be more readable. Change-Id: I71e9b331d20b5ae70175450c3346be43ab56c40c
cffb19c
3f9ea2d386
d6c1126fab
e2c9b1af3e
d2a4e1b39c