Java Object Deserialize from File deserialiseObject(File f)

Here you can find the source of deserialiseObject(File f)

Description

deserialise Object

License

Open Source License

Declaration

public static Object deserialiseObject(File f) throws IOException, ClassNotFoundException 

Method Source Code


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

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

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectInputStream;

public class Main {
    public static Object deserialiseObject(File f) throws IOException, ClassNotFoundException {

        //use buffering
        InputStream file = new FileInputStream(f);
        InputStream buffer = new BufferedInputStream(file);
        ObjectInput input = new ObjectInputStream(buffer);

        //deserialize the List
        Object object = input.readObject();

        input.close();/*from  w ww.  j  a  v a  2s  .  c o m*/

        return object;

    }
}

Related

  1. deserialisasi(String sFile)
  2. deserialization(String filePath)
  3. deserialize(File file)
  4. deserialize(File file)
  5. deserialize(File file)