List of utility methods to do Object Deserialize from File
Object | deserialize(final String path) Convenience method for deserializing an object from a file. Object result; FileInputStream inputStream = new FileInputStream(path); ObjectInputStream objectInputStream = null; try { objectInputStream = new ObjectInputStream(inputStream); result = objectInputStream.readObject(); } catch (IOException e) { inputStream.close(); ... |
T | deserialize(String filename) Convenience method used to deserialize objects from a file return (T) deserialize(new BufferedInputStream(new FileInputStream(filename))); |
Object | deserialize(String fileName) deserialize ObjectInputStream ois = null; try { FileInputStream in = new FileInputStream(fileName); ois = new ObjectInputStream(in); return ois.readObject(); } catch (Exception e) { throw new RuntimeException(e); } finally { ... |
T | deserialize(String filename) deserialize ObjectInputStream ois = null; T t = null; try { final FileInputStream fichier = new FileInputStream(filename); ois = new ObjectInputStream(fichier); t = (T) ois.readObject(); } catch (final java.io.IOException e) { e.printStackTrace(); ... |
Object | Deserialize(String filePath) Deserializes an object Object result = null; if (!new File(filePath).exists()) return result; FileInputStream fileStream = new FileInputStream(filePath); ObjectInputStream objectStream = new ObjectInputStream(fileStream); result = objectStream.readObject(); return result; |
T | deserialize(String filePath) deserialize try (ObjectInputStream in = new ObjectInputStream(new FileInputStream(new File(filePath)))) { return (T) in.readObject(); } catch (ClassNotFoundException e) { throw new IOException(e); |
Object | deserialize(String fName) Read a serialized object from the file. File file = new File(fName); if (!file.exists()) throw new IllegalArgumentException("file does not exist:" + fName); ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file))); try { return ois.readObject(); } finally { ois.close(); ... |
Object | deserialize(String fname) deserialize return deserialize(new File(fname), false); |
Object | deserialize(String path) deserialize Logger log = Logger.getAnonymousLogger(); FileInputStream fileIn = new FileInputStream(path); ObjectInputStream in = new ObjectInputStream(fileIn); Object result = in.readObject(); in.close(); fileIn.close(); log.log(Level.INFO, "Deserialized from " + path); return result; ... |
Object | deserialize(String path) deserialize FileInputStream fin = new FileInputStream(path); ObjectInputStream oin = new ObjectInputStream(fin); Object value = oin.readObject(); oin.close(); fin.close(); return value; |