code: static public Object deserialize(InputStream in, Class<?> cls)
  		throws IOException
  	{
  		if (cls==null)
  			throw new NullPointerException("cls");
  		
  		Object obj = deserialize(in);
  		if (!cls.isInstance(obj))
  		{
  			throw new InvalidObjectException("type of deserialized instance not of required class.");
  		}
  		
  		return obj;
  	}
docs: Deserializes the object contained in the given input stream.
  @param in	The input stream to deserialize an object from.
  @param cls	The expected class of the deserialized object.