public static String inputStreamToString ( InputStream in ) { StringBuffer buffer = new StringBuffer ( ) ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( in , "UTF-8" ) , 1024 ) ; String line ; while ( ( line = br . readLine ( ) ) != null ) { buffer . append ( line ) ; } } catch ( IOException iox ) { LOGR . warning ( iox . getMessage ( ) ) ; } return buffer . toString ( ) ; }
Reads the content of an input stream into a String value using the UTF - 8 charset .