public static String readContentAsString ( InputStream is , String encoding ) { String res = null ; try { res = IOUtils . toString ( is , encoding ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } finally { try { is . close ( ) ; } catch ( Exception e ) { // } } return res ; }
Read the Stream content as a string