code: private static String getStringFromInputStream(InputStream is)
      {
          BufferedReader br = null;
          StringBuilder sb = new StringBuilder();
  
          String line;
          try
          {
              br = new BufferedReader(new InputStreamReader(is));
              while((line = br.readLine()) != null)
              {
                  sb.append(line);
              }
  
          }
          catch(IOException e)
          {
              logger.severe("Unable to get string from stream: "+e.getClass().getName()+": "+e.getMessage());
          }
          finally
          {
              try
              {
                  if(br != null)
                      br.close();
              }
              catch(IOException e)
              {
              }
          }
  
          return sb.toString();
      }
docs: Extracts the string from the given input stream.
  @param is The input stream
  @return The string extracted