}
private void createBlockFile(StorageDir dir, long blockId, int blockSize) throws IOException {
byte[] buf = TestUtils.getIncreasingByteArray(blockSize);
BlockHandler bhSrc =
BlockHandler.get(CommonUtils.concat(dir.getUserTempFilePath(mUserId, blockId)));
try {
bhSrc.append(0, ByteBuffer.wrap(buf));
} finally {
bhSrc.close();
}
dir.requestSpace(mUserId, blockSize);
dir.cacheBlock(mUserId, blockId);
}