Code example for ObjectOutputStream

Methods: close, writeLong

0
	} 
 
	public void test_17_writeLong() { 
		// Test for method void java.io.ObjectOutputStream.writeLong(long) 
		try { 
			oos.writeLong(Long.MAX_VALUE);
			oos.close();
			ois = new ObjectInputStream(loadStream());
			assertTrue("Wrote incorrect double value",
					ois.readLong() == Long.MAX_VALUE);
		} catch (IOException e) {
			fail("IOException serializing data : " + e.getMessage());
		} 
	} 
 
	public void test_19_writeShort() { 
		// Test for method void java.io.ObjectOutputStream.writeShort(int) 
		try { 
			oos.writeShort(127);
			oos.close();
			ois = new ObjectInputStream(loadStream());