Java Object Save writeObjectToFile(File file, Object o)

Here you can find the source of writeObjectToFile(File file, Object o)

Description

write Object To File

License

Apache License

Declaration

public static void writeObjectToFile(File file, Object o) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.*;

public class Main {
    public static void writeObjectToFile(File file, Object o) throws IOException {
        ObjectOutputStream oop = new ObjectOutputStream(new FileOutputStream(file));
        oop.writeObject(o);//  w  w  w .  j  a v a2s  .c o m
        oop.close();
    }
}

Related

  1. writeObject(Object obj, ObjectOutput out)
  2. writeObject(Object object)
  3. writeObject(Object object, File destinationFile)
  4. writeObject(Object object, String path)
  5. writeObject(Object p_object, File p_outFile)
  6. writeObjectToFile(File file, Object obj)
  7. writeObjectToFile(final Object o, final File dir)
  8. writeObjectToFile(Object o, File file, boolean append)
  9. writeObjectToFile(Object o, String filename)