Java ObjectOutputStream Write load(File file)

Here you can find the source of load(File file)

Description

load

License

Open Source License

Declaration

public static Object load(File file) 

Method Source Code


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

import java.io.File;
import java.io.FileInputStream;

import java.io.IOException;
import java.io.ObjectInputStream;

public class Main {
    public static Object load(File file) {
        Object o = null;/*www. j a v  a 2s.  co  m*/
        try {
            ObjectInputStream s = new ObjectInputStream(new FileInputStream(file));
            o = s.readObject();
            s.close();
        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }
        return o;
    }
}

Related

  1. load(File f)
  2. load(File file)
  3. load(File file, Class type)
  4. load(File file, final ClassLoader... loaders)
  5. load(String fileName)
  6. load(String filename)