List of utility methods to do Object Deserialize from File
T | deserialize(String path) Deserialize object. return deserialize(new FileInputStream(path)); |
Object | deserializeFromDisk(String filePath) Deserializes an object from disk. ObjectInputStream in = new ObjectInputStream(new FileInputStream(new File(filePath))); return in.readObject(); |
T | deserializeFromFile(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(); |
Object | deserializeFromFile(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(); ... |
T | deserializeFromFile(String path) deserialize From File FileInputStream fileIn = new FileInputStream(path); T e = deserialize(fileIn); fileIn.close(); return e; |
Object | deserializeFromFile(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; |
Map | deserializeMap(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; ... |
Object | deserializeMyContext(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) { ... |
Object | deserializeObject(String classpathFileName) deserialize Object InputStream streamIn = Thread.currentThread().getContextClassLoader() .getResourceAsStream(classpathFileName); ObjectInputStream objectinputstream = new ObjectInputStream(streamIn); return objectinputstream.readObject(); |
Object | deserializeObject(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) { ... |