Back to project page Profiterole.
The source code is released under:
Apache License
If you think the Android project Profiterole listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package profiterole.waffle; // ww w . j a v a 2 s . c o m import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import profiterole.api.Waffle; public class WaffleUtils { private WaffleUtils() { throw new AssertionError("can't be here"); } public static Waffle<?> readFromFile(File f) throws Exception { Waffle<?> waffle = null; FileInputStream fis = null; ObjectInputStream in = null; fis = new FileInputStream(f); in = new ObjectInputStream(fis); waffle = (Waffle<?>)in.readObject(); in.close(); return waffle; } public static void writeToFile(Waffle<?> w, File f) throws IOException { FileOutputStream fos = null; ObjectOutputStream out = null; fos = new FileOutputStream(f); out = new ObjectOutputStream(fos); out.writeObject(w); out.close(); } }