Merge "Don't pad before calling writeInPlace()." into pi-dev
am: cfa4928af7

Change-Id: I86224b9ea02dd5906776b6ad24888f5fe7d57bc4