写入文件到指定路径

        /**
	 * 写入文件到指定路径
	 * 
	 * @param workbook
	 *            填充好的workbook
	 * @param path
	 *            存放的位置
	 */
	public static void outFile(HSSFWorkbook workbook, String path) {
		OutputStream os = null;
		try {
			os = new FileOutputStream(new File(path));
			workbook.write(os);
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		try {
			os.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

猜你喜欢

转载自blog.csdn.net/weixin_39249630/article/details/80703342
今日推荐