kodejava-cryptography/src/main/java/org/kodejava/example/crypto/ObjectEncrypt.java
private static void writeToFile(String filename, Object object) throws Exception {
        try (FileOutputStream fos = new FileOutputStream(new File(filename));
             ObjectOutputStream oos = new ObjectOutputStream(fos)) {

            oos.writeObject(object);
        }
    }
// Store object in a file for future use.
Store object in a file for future use.
Store object in a file for future use .
private static void writeToFile(String filename, Object object) throws Exception {
        try (FileOutputStream fos = new FileOutputStream(new File(filename));
             ObjectOutputStream oos = new ObjectOutputStream(fos)) {
            oos.writeObject(object);
        }
    }
private static void writeToFile ( String filename , Object object ) throws Exception { try ( FileOutputStream fos = new FileOutputStream ( new File ( filename ) ) ; ObjectOutputStream oos = new ObjectOutputStream ( fos ) ) { oos . writeObject ( object ) ; } }
Store object in a file for future use.
Store object in a file for future use .