All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.math.io.files.DataFile Maven / Gradle / Ivy

The newest version!
package org.math.io.files;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * BSD License
 * 
 * @author Yann RICHET
 */

public abstract class DataFile {

    protected File file;

    public DataFile(File f) {
        file = f;
    }

    public static void copyFile(File in, File out) throws IOException {
        FileInputStream fis = new FileInputStream(in);
        FileOutputStream fos = new FileOutputStream(out);
        byte[] buf = new byte[1024];
        int i = 0;
        while ((i = fis.read(buf)) != -1) {
            fos.write(buf, 0, i);
        }
        fis.close();
        fos.close();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy