Code example for ObjectInputStream

Methods: readDouble

0
	public void test_14_writeDouble() { 
		// Test for method void java.io.ObjectOutputStream.writeDouble(double) 
		try { 
			oos.writeDouble(Double.MAX_VALUE);
			oos.close();
			ois = new ObjectInputStream(loadStream());
			assertTrue("Wrote incorrect double value",
					ois.readDouble() == Double.MAX_VALUE);
		} catch (IOException e) {
			fail("IOException serializing data : " + e.getMessage());
		} 
	} 
 
	public void test_15_writeFloat() { 
		// Test for method void java.io.ObjectOutputStream.writeFloat(float) 
		try { 
			oos.writeFloat(Float.MAX_VALUE);
			oos.close();
			ois = new ObjectInputStream(loadStream());
			assertTrue("Wrote incorrect double value",
					ois.readFloat() == Float.MAX_VALUE);