Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.util.Base64;
import java.io.File;

import java.io.FileOutputStream;

public class Main {
    public static String decodeToFile(File desFile, String encodedString) {
        try {
            byte[] decodeBytes = Base64.decode(encodedString.getBytes(), Base64.NO_WRAP);
            FileOutputStream fos = new FileOutputStream(desFile);
            fos.write(decodeBytes);
            fos.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}