Added writeFileBytes function.