Code example for ObjectInputStream

Methods: closereadUTF

0
		// Create stream 
		FileInputStream fis = new FileInputStream("out.txt");
		BufferedInputStream bis = new BufferedInputStream(fis);
		//CipherInputStream cis = new CipherInputStream(bis, desCipher); 
		//ObjectInputStream ois = new ObjectInputStream(cis); 
		ObjectInputStream ois = new ObjectInputStream(bis);
		 
		// Read  
		String plaintext2 = ois.readUTF();
		ois.close();
 
		// Compare 
		System.out.println(plaintext);
		System.out.println(plaintext2);
		System.out.println("Identical? " + (plaintext.equals(plaintext2)));
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java