Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.FileOutputStream;

public class Main {
    /**
     * @param fileName 
     * @param message
     */
    public static void writeFileSdcard(String fileName, String message) {

        try {

            FileOutputStream fout = new FileOutputStream(fileName);
            byte[] bytes = message.getBytes();
            fout.write(bytes);
            fout.flush();
            fout.close();
        }

        catch (Exception e) {

            e.printStackTrace();

        }

    }
}