@SuppressWarnings("unchecked")
    public static <T> CoreObject<T> deserializeCore(Class<T> type, InputStream fis,
                                                       CommonCore core) {
        try {
            final GZIPInputStream gis = new GZIPInputStream(fis);
            final ObjectInputStream ois = new ObjectInputStream(gis);

            final CoreObject<T> rval = (CoreObject<T>) ois.readObject();
            final Field field = Core.class.getDeclaredField("commonCore");
            field.setAccessible(true);
            field.set(rval, core);
            return rval;
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        }
        return null;
    }