oos

public void save(File file, List<String> decisions) throws IOException { ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(new FileOutputStream(file)); oos.writeObject(decisions); } finally { if (oos != null) { oos.close(); } } } public List<String> load(File file) throws IOException, ClassNotFoundException { ObjectInputStream ois = null; try { ois = new ObjectInputStream(new FileInputStream(file)); List<String> decisions = (List<String>) ois.readObject(); return decisions; } finally { if (ois != null) { ois.close(); } } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.