public static String streamToString ( InputStream is , String charsetName ) { try { Reader r = null ; try { r = new BufferedReader ( new InputStreamReader ( is , charsetName ) ) ; return readerToString ( r ) ; } finally { if ( r != null ) { try { r . close ( ) ; } catch ( IOException e ) { } } } } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Transforms a stream into a string .