Here you can find the source of dumpStringArray(Path outputFilePath, String[] stringArray)
public static void dumpStringArray(Path outputFilePath, String[] stringArray) throws IOException
//package com.java2s; /**// w ww. j a v a 2s. c o m * Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import java.io.BufferedWriter; import java.io.IOException; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static void dumpStringArray(Path outputFilePath, String[] stringArray) throws IOException { try (BufferedWriter os = Files.newBufferedWriter(outputFilePath, Charset.forName("UTF-8"))) { for (int i = 0; i < stringArray.length; i++) { os.write(stringArray[i]); os.newLine(); } } } }