Java UTF8 appendToFile(String outputFile, String contents)

Here you can find the source of appendToFile(String outputFile, String contents)

Description

append To File

License

Open Source License

Declaration

public static void appendToFile(String outputFile, String contents) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.nio.file.Files;

import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;

public class Main {
    public static void appendToFile(String outputFile, String contents) {
        try {/*from w w  w  . j a  va2 s  .co m*/
            Files.write(Paths.get(outputFile), contents.getBytes(), StandardOpenOption.APPEND);
        } catch (IOException e) {
            throw new UnsupportedOperationException("Failed to append to file '" + outputFile + "'", e);
        }
    }
}

Related

  1. addLineIds(String inFile, String outFile)
  2. asStringUTF8(byte[] bytes)
  3. asUTF16BEEncoded(String basicString)
  4. asUtf8(byte[] bytes)
  5. asUTF8(InputStream in)