Here you can find the source of toIOException(Throwable e)
static IOException toIOException(Throwable e)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { static IOException toIOException(Throwable e) { if (e instanceof IOException) { return (IOException) e; } else {// ww w .j a v a 2s . c om return new IOException(e.getMessage()); } } }