Code example for ObjectInputStream

Methods: readObject

0
            return null; 
        } 
 
        ObjectInputStream in = null;
        try { 
            in = new ObjectInputStream(new FileInputStream(file));
            T result = (T) in.readObject();
            Log.i(TAG, "Deserialized object from " + file);
            return result;
        } catch (Throwable x) {
            Log.w(TAG, "Failed to deserialize object from " + file, x);
            return null; 
        } finally { 
            Util.close(in);
        } 
    } 
}