Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.*;

public class Main {
    /**
     * Opens a buffered writer that uses UTF-8 encoding.
     * TODO: handle compression automatically based on file extension.
     * @param path
     * @return
     * @throws IOException
     */
    public static BufferedWriter openWriterForAppend(File path) throws IOException {
        return new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path, true), "UTF-8"));
    }
}