public static String inputStreamToString(InputStream inputStream){
  StringWriter stringWriter=new StringWriter();
  try {
    IOUtils.copy(inputStream,stringWriter);
  }
 catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
  return stringWriter.toString();
}

public static String inputStreamToString ( InputStream inputStream ) { StringWriter stringWriter = new StringWriter ( ) ; try { IOUtils . copy ( inputStream , stringWriter ) ; } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } return stringWriter . toString ( ) ; }
this is a utility method that loads the contents of the given input stream into a string .
