/* JSONHelper.java * * Copyright 2010-2011 Johannes Kepler Universit�t Linz, * Institut f�r Wissensbasierte Mathematische Systeme. * * This file is part of pureImage. * * pureImage is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 3, * as published by the Free Software Foundation. * * pureImage is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with pureImage. If not, see <http://www.gnu.org/licenses/>. */ package pI.generator; import java.io.File; import java.io.FileInputStream; import java.io.IOException; public class JSONHelper { public static String readFile(String file) throws IOException { int len = (int) (new File(file)).length(); FileInputStream fis = new FileInputStream(file); byte buf[] = new byte[len]; fis.read(buf); fis.close(); return new String(buf); } }