Back to project page RPGWorld.
The source code is released under:
MIT License
If you think the Android project RPGWorld listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/**FileIO.java * Daniel Pok//w ww .j a va 2 s . c om * AP Java 6th * May 22, 2013 */ package com.nokarateclass.rpgworld.io; /** * @author dh.dpok * */ public class FileIO { //variables String fileName; public FileIO(String file){ fileName = file; } public boolean save(Object obj){ return FileExporter.writeObjectToFile(fileName, obj); } public Object read(){ return FileImporter.readObjectFromFile(fileName); } @SuppressWarnings("unchecked") public <T> T readType(){ Object obj = FileImporter.readObjectFromFile(fileName); try{ T result = (T) obj;//this is where the unchecked warning is suppressed return result; } catch(ClassCastException ex){ return null; } } }