kodejava-cryptography/src/main/java/org/kodejava/example/crypto/ObjectDecrypt.java
private static Object readFromFile(String filename) throws Exception {
        try (FileInputStream fis = new FileInputStream(new File(filename));
             ObjectInputStream ois = new ObjectInputStream(fis)) {

            return ois.readObject();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
// Method for reading object stored in a file.
Method for reading object stored in a file.
Method for reading object stored in a file .
private static Object readFromFile(String filename) throws Exception {
        try (FileInputStream fis = new FileInputStream(new File(filename));
             ObjectInputStream ois = new ObjectInputStream(fis)) {
            return ois.readObject();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
private static Object readFromFile ( String filename ) throws Exception { try ( FileInputStream fis = new FileInputStream ( new File ( filename ) ) ; ObjectInputStream ois = new ObjectInputStream ( fis ) ) { return ois . readObject ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ; }
Method for reading object stored in a file.
Method for reading object stored in a file .