Java Utililty Methods Object Deserialize from File

List of utility methods to do Object Deserialize from File

Description

The list of methods to do Object Deserialize from File are organized into topic(s).

Method

Tdeserialize(String path)
Deserialize object.
return deserialize(new FileInputStream(path));
ObjectdeserializeFromDisk(String filePath)
Deserializes an object from disk.
ObjectInputStream in = new ObjectInputStream(new FileInputStream(new File(filePath)));
return in.readObject();
TdeserializeFromFile(File file)
deserialize From File
if (file == null)
    return null;
FileInputStream fis = new FileInputStream(file);
try {
    return (T) deserialize(new BufferedInputStream(fis));
} finally {
    fis.close();
ObjectdeserializeFromFile(File file)
Utility method to deserialize an Object from given File.
ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)));
Object object;
try {
    object = ois.readObject();
} catch (ClassNotFoundException e) {
    throw new RuntimeException(e);
ois.close();
...
TdeserializeFromFile(String path)
deserialize From File
FileInputStream fileIn = new FileInputStream(path);
T e = deserialize(fileIn);
fileIn.close();
return e;
ObjectdeserializeFromFile(String path)
deserialize From File
FileInputStream fis = new FileInputStream(path);
GZIPInputStream gzip = new GZIPInputStream(fis);
ObjectInputStream ois = new ObjectInputStream(gzip);
Object object = ois.readObject();
ois.close();
return object;
MapdeserializeMap(File file)
Deserialize a map
Map<?, ?> map;
try {
    ObjectInputStream is = new ObjectInputStream(new FileInputStream(file));
    map = (Map<?, ?>) is.readObject();
    is.close();
} catch (Exception e) {
    e.printStackTrace();
    return null;
...
ObjectdeserializeMyContext(String path)
deserialize My Context
File file = new File(path);
InputStream fis = new FileInputStream(file);
ObjectInputStream ois = null;
Object object = null;
try {
    ois = new ObjectInputStream(fis);
    object = ois.readObject();
} catch (Exception e) {
...
ObjectdeserializeObject(String classpathFileName)
deserialize Object
InputStream streamIn = Thread.currentThread().getContextClassLoader()
        .getResourceAsStream(classpathFileName);
ObjectInputStream objectinputstream = new ObjectInputStream(streamIn);
return objectinputstream.readObject();
ObjectdeserializeObject(String inputFileName)
Load the characterization from the serialized version stored in a file.
Object toLoad = null;
try {
    FileInputStream fileIn = new FileInputStream(inputFileName);
    ObjectInputStream in = new ObjectInputStream(fileIn);
    toLoad = in.readObject();
    in.close();
    fileIn.close();
} catch (IOException ioException) {
...