Java Object Serialize serialize(final String path, final Object object)

Here you can find the source of serialize(final String path, final Object object)

Description

Convenience method for serializing an object into a file.

License

Open Source License

Declaration

public static void serialize(final String path, final Object object) throws IOException 

Method Source Code


//package com.java2s;
import java.io.*;

public class Main {
    /**//from ww w .jav a 2  s.  co  m
     * <p>Convenience method for serializing an object into a file.</p>
     */
    public static void serialize(final String path, final Object object) throws IOException {
        final ObjectOutputStream stream = new ObjectOutputStream(new FileOutputStream(path));
        stream.writeObject(object);
        stream.close();
    }
}

Related

  1. serialize(final File file, final Object o)
  2. serialize(final Object object)
  3. serialize(final Object object, final File file)
  4. serialize(final Serializable obj)
  5. serialize(final Serializable object)
  6. serialize(final String pFilename, final T pObject)
  7. serialize(java.io.Serializable obj)
  8. serialize(Object c, ScriptableObject scope)
  9. serialize(Object o)