Code example for InvocationTargetException

Methods: getCause

0
      return constructor.newInstance(out, deflater, syncFlush);
    } catch (NoSuchMethodException e) {
      throw new UnsupportedOperationException("Cannot SPDY; no SYNC_FLUSH available");
    } catch (InvocationTargetException e) {
      throw e.getCause() instanceof RuntimeException ? (RuntimeException) e.getCause()
          : new RuntimeException(e.getCause());
    } catch (InstantiationException e) {
      throw new RuntimeException(e);
    } catch (IllegalAccessException e) {
      throw new AssertionError();
    } 
  } 
 
  /** 
   * Returns the maximum transmission unit of the network interface used by 
   * {@code socket}, or a reasonable default if this platform doesn't expose the 
   * MTU to the application layer. 
   * 
   * <p>The returned value should only be used as an optimization; such as to 
   * size buffers efficiently. 
   */