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

org.deeplearning4j.util.FileOperations Maven / Gradle / Ivy

There is a newer version: 1.0.0-M2.1
Show newest version
package org.deeplearning4j.util;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class FileOperations {

	private FileOperations() {}
	
	
	
	public static OutputStream createAppendingOutputStream(File to) {
		try {
			BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(to,true));
			return bos;
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
	
	public static void appendTo(String data,File append) {
		try {
			BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(append,true));
			bos.write(data.getBytes());
			bos.flush();
			bos.close();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy