Code example for ObjectInputStream

Methods: close, readObject

0
		oos.close(); 
		baos.close(); 
 
		// read from byte array 
		ByteArrayInputStream bais = new ByteArrayInputStream(buffer); 
		ObjectInputStream ois = new ObjectInputStream(bais); 
		NotContextException exception2 = (NotContextException) ois.readObject(); 
		ois.close(); 
		bais.close(); 
 
		assertEquals(exception.getExplanation(), exception2.getExplanation()); 
		assertEquals(exception.getResolvedObj(), exception2.getResolvedObj()); 
		assertEquals(exception.getRemainingName(), exception2 
				.getRemainingName()); 
		assertEquals(exception.getResolvedName(), exception2.getResolvedName()); 
		assertEquals(exception.getRootCause().getMessage(), exception2 
				.getRootCause().getMessage()); 
		assertEquals(exception.getRootCause().getClass(), exception2 
				.getRootCause().getClass()); 
	}