Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.File;

import java.io.FileOutputStream;

import android.util.Base64;

public class Main {
    public static void saveEncodedFile(String encoded, File file) throws Exception {
        byte[] decodedAsBytes = Base64.decode(encoded, Base64.DEFAULT);

        FileOutputStream os = new FileOutputStream(file, true);
        os.write(decodedAsBytes);
        os.flush();
        os.close();
    }
}