File newFile = new File(tempDir + File.separatorChar + UUID.randomUUID().toString() + ".csv");
Files.createParentDirs(newFile);
final byte commonCsvHead[] = {(byte) 0xEF, (byte) 0xBB, (byte) 0xBF};
Files.write(Bytes.concat(commonCsvHead, stringBuilder.toString().getBytes(Charsets.UTF_8.toString())), newFile);
转载于:https://my.oschina.net/u/1426871/blog/300751