Java ObjectOutputStream Write saveInSerFile(String filename, T object)

Here you can find the source of saveInSerFile(String filename, T object)

Description

save In Ser File

License

Open Source License

Declaration

public static <T> void saveInSerFile(String filename, T object)
            throws FileNotFoundException, IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import java.io.IOException;

import java.io.ObjectOutputStream;

public class Main {
    public static <T> void saveInSerFile(String filename, T object)
            throws FileNotFoundException, IOException {
        ObjectOutputStream output = new ObjectOutputStream(
                new FileOutputStream(new File(filename)));
        try {/*from  w  w  w.jav  a 2  s. c  o m*/
            output.writeObject(object);
        } finally {
            output.close();
        }
    }
}

Related

  1. saveDate(String path, Object obj)
  2. saveFile(Object o, File file)
  3. saveFile(Object o, String filename)
  4. saveGZipObject(Object toSave, File file)
  5. saveIndex(String path, Serializable obj)
  6. saveObject(File file, Object o, boolean overwrite)
  7. saveObject(File file, Serializable obj)
  8. saveObject(Object o, File f)
  9. saveObject(Object obj, File file)