Java Object Serialize serialize(Serializable s, File dir, String fileName)

Here you can find the source of serialize(Serializable s, File dir, String fileName)

Description

serialize

License

Apache License

Declaration

public static void serialize(Serializable s, File dir, String fileName)
            throws FileNotFoundException, IOException 

Method Source Code


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

import java.io.File;

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

import java.io.ObjectOutputStream;
import java.io.Serializable;

public class Main {
    public static void serialize(Serializable s, File dir, String fileName)
            throws FileNotFoundException, IOException {
        new ObjectOutputStream(new FileOutputStream(dir.getPath() + File.separator + fileName)).writeObject(s);
    }//from ww w  .j  a  v  a2 s  . com
}

Related

  1. serialize(Serializable object)
  2. serialize(Serializable object)
  3. serialize(Serializable object)
  4. serialize(Serializable object, File dest)
  5. serialize(Serializable object, String fileName)
  6. serialize(Serializable serializable)
  7. serialize(Serializable... objects)
  8. serialize(String filename, T obj)
  9. serialize(String path, String name, Object obj)