Java ObjectOutputStream Write loadGZipObject(File file)

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

Description

load G Zip Object

License

Open Source License

Declaration

public static Object loadGZipObject(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;

import java.util.zip.GZIPInputStream;

public class Main {
    public static Object loadGZipObject(File file) {
        Object obj = null;/*from ww  w .j  av a  2s.  c  o  m*/
        FileInputStream fis = null;
        GZIPInputStream gis = null;
        ObjectInputStream ois = null;
        try {
            fis = new FileInputStream(file);
            gis = new GZIPInputStream(fis);
            ois = new ObjectInputStream(gis);
            obj = ois.readObject();
            ois.close();
            gis.close();
            fis.close();
        } catch (IOException ioe) {
            ioe.printStackTrace();
        } catch (ClassNotFoundException cnfe) {
            cnfe.printStackTrace();
        }
        return obj;
    }
}

Related

  1. load(String name, Class resultClass)
  2. load(String path)
  3. loadAllPlaying(String path)
  4. loadData(Class expectedClass, String filename)
  5. loadData(HashMap data, String filename)
  6. LoadMatFromFile(double[] mat, String filename)
  7. loadObj(String file)
  8. loadSerializableFile(File file)
  9. loadSerialized(File file)