Android Open Source - gatoloco File Utils






From Project

Back to project page gatoloco.

License

The source code is released under:

GNU General Public License

If you think the Android project gatoloco listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.grumpycat.utils;
/*  w w w .  j  av  a2 s  .  co  m*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;


public class FileUtils {

  public static boolean copyFile(String src, String dest) throws IOException {
    File inputFile = new File(src);
    File outputFile = new File(String.format(
        dest, System.currentTimeMillis()));
    InputStream in = new FileInputStream(inputFile);
    OutputStream out = new FileOutputStream(outputFile);
    byte[] buffer = new byte[1024];
    int read;
    while ((read = in.read(buffer)) != -1) {
      out.write(buffer, 0, read);
    }
    in.close();
    in = null;
    out.flush();
    out.close();
    out = null;
    return true;
  }
}




Java Source Code List

com.grumpycat.Config.java
com.grumpycat.GalleryActivity.java
com.grumpycat.MainActivity.java
com.grumpycat.Preview.java
com.grumpycat.SaveActivity.java
com.grumpycat.SnapShotActivity.java
com.grumpycat.SplashActivity.java
com.grumpycat.utils.FileUtils.java