code: public static IOException createIOException(Throwable t)
     {
        IOException ex = new IOException(t.getMessage());
        ex.initCause(t);
        return ex;
     }
docs: Creates an {@link IOException} with <code>t</code> as its cause.
  
  @param t the cause.