package edu.fichte.pbi.ide.commonsstolen;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.StringWriter;

public class FileUtils {

	public static String readFileToString(File file) throws IOException {
		char[] buf = new char[10000];
		int c = 0;
		BufferedReader reader = new BufferedReader(new FileReader(file));
		StringWriter stringWriter = new StringWriter();
		while(-1!=(c=reader.read(buf))){
			stringWriter.write(buf,0,c);
		}
		reader.close();
		return stringWriter.toString();
	}

}
