Code example for ObjectInputStream

Methods: readInt

0
	public static int CitizensBighouseMax;
	public static int CitizensBighouseCurrent;
	 
	public static void loadFromStream(ObjectInputStream i) throws IOException
	{ 
		CitizensHouseMax = i.readInt();
		CitizensHouseCurrent = i.readInt();
		CitizensBighouseMax = i.readInt();
		CitizensBighouseCurrent = i.readInt();
	} 
	 
	public static void saveToStream(ObjectOutputStream o) throws IOException
	{ 
		 o.writeInt(CitizensHouseMax);
		 o.writeInt(CitizensHouseCurrent);
		 o.writeInt(CitizensBighouseMax);
		 o.writeInt(CitizensBighouseCurrent);
	} 
 
	public static int      citizens      = 0;                                //The citizens that live in the city
Experience pair programming with AI  Get Codota for Java