code: public static String readStringFromResources(InputStream _stream, String _charset) {
          if (_stream == null) {
              LOGGER.error("Error: null-Stream received!");
              return null;
          }
  
          StringBuilder sb = new StringBuilder(100);
  
          BufferedReader br;
          try {
              br = new BufferedReader(new InputStreamReader(_stream, _charset));
              for (int c = br.read(); c != -1; c = br.read()) {
                  sb.append((char) c);
              }
          } catch (IOException _ex) {
              LOGGER.error("Error while reading resource to string: ", _ex);
          }
  
          return sb.toString();
      }
docs: Read a Resource-file (eg. Text) to String.
  
  @param _stream
  @param _charset
  @return the file as string, or null on error