public static String readContent ( InputStream is ) { String ret = "" ; try { String line ; BufferedReader in = new BufferedReader ( new InputStreamReader ( is ) ) ; StringBuffer out = new StringBuffer ( ) ; while ( ( line = in . readLine ( ) ) != null ) { out . append ( line ) . append ( CARRIAGE_RETURN ) ; } ret = out . toString ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return ret ; }
Gets string content from InputStream